Chilkat Online Tools

unicodeC / Zoho CRM REST APIs / Subforms

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkJsonObjectW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *Name;
    const wchar_t *Id;
    const wchar_t *v_Email;
    const wchar_t *Company;
    const wchar_t *Scurrency_symbol;
    const wchar_t *Interested_Leads;
    const wchar_t *Last_Activity_Time;
    const wchar_t *Industry;
    const wchar_t *Sstate;
    const wchar_t *Unsubscribed_Mode;
    BOOL Sconverted;
    BOOL Sprocess_flow;
    int Exchange_Rate;
    const wchar_t *v_Currency;
    const wchar_t *Street;
    const wchar_t *Zip_Code;
    const wchar_t *Data_Processing_Basis_Details;
    const wchar_t *id;
    const wchar_t *Data_Source;
    BOOL Sapproved;
    BOOL Delegate;
    BOOL Approve;
    BOOL Reject;
    BOOL Resubmit;
    const wchar_t *Sdata_source_details;
    const wchar_t *Created_Time;
    BOOL Seditable;
    const wchar_t *City;
    int No_of_Employees;
    const wchar_t *State;
    const wchar_t *Country;
    const wchar_t *Created_ByName;
    const wchar_t *Created_ById;
    const wchar_t *Created_ByEmail;
    int Annual_Revenue;
    const wchar_t *Secondary_Email;
    const wchar_t *Description;
    const wchar_t *Rating;
    BOOL Sreview_processApprove;
    BOOL Sreview_processReject;
    BOOL Sreview_processResubmit;
    const wchar_t *Website;
    const wchar_t *Twitter;
    const wchar_t *Scanvas_id;
    const wchar_t *Salutation;
    const wchar_t *First_Name;
    const wchar_t *Lead_Status;
    const wchar_t *Full_Name;
    const wchar_t *Record_Image;
    const wchar_t *Modified_ByName;
    const wchar_t *Modified_ById;
    const wchar_t *Modified_ByEmail;
    const wchar_t *Sreview;
    const wchar_t *Skype_ID;
    const wchar_t *Phone;
    const wchar_t *HIPAA;
    BOOL Email_Opt_Out;
    const wchar_t *Designation;
    const wchar_t *Modified_Time;
    const wchar_t *Unsubscribed_Time;
    const wchar_t *Mobile;
    BOOL Sorchestration;
    BOOL Sstop_processing;
    const wchar_t *Last_Name;
    BOOL Sin_merge;
    const wchar_t *Lead_Source;
    const wchar_t *Fax;
    const wchar_t *Sapproval_state;
    int j;
    int count_j;
    int i;
    int count_i;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttpW_putAuthToken(http,L"<access_token>");

    sbResponseBody = CkStringBuilderW_Create();
    success = CkHttpW_QuickGetSb(http,L"https://domain.com/crm/v2/Leads/{{record_id}}",sbResponseBody);
    if (success == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkStringBuilderW_Dispose(sbResponseBody);
        return;
    }

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpW_getLastStatus(http);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpW_lastHeader(http));
        wprintf(L"Failed.\n");
        CkHttpW_Dispose(http);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "data": [
    //     {
    //       "Owner": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009",
    //         "email": "patricia.ss@zylker.com"
    //       },
    //       "Company": null,
    //       "Email": null,
    //       "$currency_symbol": "Af",
    //       "Interested_Leads": null,
    //       "Last_Activity_Time": "2021-05-07T13:10:11+00:00",
    //       "Industry": null,
    //       "$state": "save",
    //       "Unsubscribed_Mode": null,
    //       "$converted": false,
    //       "$process_flow": false,
    //       "Exchange_Rate": 1,
    //       "Currency": "AFN",
    //       "Street": null,
    //       "Zip_Code": "1234",
    //       "Data_Processing_Basis_Details": null,
    //       "id": "738964000002131001",
    //       "Data_Source": "Manual",
    //       "$approved": true,
    //       "$approval": {
    //         "delegate": false,
    //         "approve": false,
    //         "reject": false,
    //         "resubmit": false
    //       },
    //       "$data_source_details": null,
    //       "Created_Time": "2021-05-07T06:23:10+00:00",
    //       "$editable": true,
    //       "City": null,
    //       "No_of_Employees": 1000,
    //       "State": "Colorado",
    //       "Country": null,
    //       "Created_By": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009",
    //         "email": "patricia.ss@zylker.com"
    //       },
    //       "Annual_Revenue": 1,
    //       "Secondary_Email": null,
    //       "Description": null,
    //       "Rating": null,
    //       "$review_process": {
    //         "approve": false,
    //         "reject": false,
    //         "resubmit": false
    //       },
    //       "Website": "https://yaythisworked.com",
    //       "Twitter": null,
    //       "$canvas_id": null,
    //       "Salutation": null,
    //       "First_Name": null,
    //       "Lead_Status": null,
    //       "Full_Name": "sample",
    //       "Record_Image": null,
    //       "Modified_By": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009",
    //         "email": "patricia.ss@zylker.com"
    //       },
    //       "$review": null,
    //       "Skype_ID": null,
    //       "Phone": null,
    //       "HIPAA": null,
    //       "Email_Opt_Out": false,
    //       "Designation": null,
    //       "Modified_Time": "2021-05-07T13:10:11+00:00",
    //       "$converted_detail": {},
    //       "Unsubscribed_Time": null,
    //       "Mobile": "9898989898",
    //       "$orchestration": false,
    //       "$stop_processing": false,
    //       "Last_Name": "sample",
    //       "$in_merge": false,
    //       "Lead_Source": null,
    //       "Tag": [
    //       ],
    //       "Fax": null,
    //       "$approval_state": "approved"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        Name = CkJsonObjectW_stringOf(jResp,L"data[i].Owner.name");
        Id = CkJsonObjectW_stringOf(jResp,L"data[i].Owner.id");
        v_Email = CkJsonObjectW_stringOf(jResp,L"data[i].Owner.email");
        Company = CkJsonObjectW_stringOf(jResp,L"data[i].Company");
        v_Email = CkJsonObjectW_stringOf(jResp,L"data[i].Email");
        Scurrency_symbol = CkJsonObjectW_stringOf(jResp,L"data[i].$currency_symbol");
        Interested_Leads = CkJsonObjectW_stringOf(jResp,L"data[i].Interested_Leads");
        Last_Activity_Time = CkJsonObjectW_stringOf(jResp,L"data[i].Last_Activity_Time");
        Industry = CkJsonObjectW_stringOf(jResp,L"data[i].Industry");
        Sstate = CkJsonObjectW_stringOf(jResp,L"data[i].$state");
        Unsubscribed_Mode = CkJsonObjectW_stringOf(jResp,L"data[i].Unsubscribed_Mode");
        Sconverted = CkJsonObjectW_BoolOf(jResp,L"data[i].$converted");
        Sprocess_flow = CkJsonObjectW_BoolOf(jResp,L"data[i].$process_flow");
        Exchange_Rate = CkJsonObjectW_IntOf(jResp,L"data[i].Exchange_Rate");
        v_Currency = CkJsonObjectW_stringOf(jResp,L"data[i].Currency");
        Street = CkJsonObjectW_stringOf(jResp,L"data[i].Street");
        Zip_Code = CkJsonObjectW_stringOf(jResp,L"data[i].Zip_Code");
        Data_Processing_Basis_Details = CkJsonObjectW_stringOf(jResp,L"data[i].Data_Processing_Basis_Details");
        id = CkJsonObjectW_stringOf(jResp,L"data[i].id");
        Data_Source = CkJsonObjectW_stringOf(jResp,L"data[i].Data_Source");
        Sapproved = CkJsonObjectW_BoolOf(jResp,L"data[i].$approved");
        Delegate = CkJsonObjectW_BoolOf(jResp,L"data[i].$approval.delegate");
        Approve = CkJsonObjectW_BoolOf(jResp,L"data[i].$approval.approve");
        Reject = CkJsonObjectW_BoolOf(jResp,L"data[i].$approval.reject");
        Resubmit = CkJsonObjectW_BoolOf(jResp,L"data[i].$approval.resubmit");
        Sdata_source_details = CkJsonObjectW_stringOf(jResp,L"data[i].$data_source_details");
        Created_Time = CkJsonObjectW_stringOf(jResp,L"data[i].Created_Time");
        Seditable = CkJsonObjectW_BoolOf(jResp,L"data[i].$editable");
        City = CkJsonObjectW_stringOf(jResp,L"data[i].City");
        No_of_Employees = CkJsonObjectW_IntOf(jResp,L"data[i].No_of_Employees");
        State = CkJsonObjectW_stringOf(jResp,L"data[i].State");
        Country = CkJsonObjectW_stringOf(jResp,L"data[i].Country");
        Created_ByName = CkJsonObjectW_stringOf(jResp,L"data[i].Created_By.name");
        Created_ById = CkJsonObjectW_stringOf(jResp,L"data[i].Created_By.id");
        Created_ByEmail = CkJsonObjectW_stringOf(jResp,L"data[i].Created_By.email");
        Annual_Revenue = CkJsonObjectW_IntOf(jResp,L"data[i].Annual_Revenue");
        Secondary_Email = CkJsonObjectW_stringOf(jResp,L"data[i].Secondary_Email");
        Description = CkJsonObjectW_stringOf(jResp,L"data[i].Description");
        Rating = CkJsonObjectW_stringOf(jResp,L"data[i].Rating");
        Sreview_processApprove = CkJsonObjectW_BoolOf(jResp,L"data[i].$review_process.approve");
        Sreview_processReject = CkJsonObjectW_BoolOf(jResp,L"data[i].$review_process.reject");
        Sreview_processResubmit = CkJsonObjectW_BoolOf(jResp,L"data[i].$review_process.resubmit");
        Website = CkJsonObjectW_stringOf(jResp,L"data[i].Website");
        Twitter = CkJsonObjectW_stringOf(jResp,L"data[i].Twitter");
        Scanvas_id = CkJsonObjectW_stringOf(jResp,L"data[i].$canvas_id");
        Salutation = CkJsonObjectW_stringOf(jResp,L"data[i].Salutation");
        First_Name = CkJsonObjectW_stringOf(jResp,L"data[i].First_Name");
        Lead_Status = CkJsonObjectW_stringOf(jResp,L"data[i].Lead_Status");
        Full_Name = CkJsonObjectW_stringOf(jResp,L"data[i].Full_Name");
        Record_Image = CkJsonObjectW_stringOf(jResp,L"data[i].Record_Image");
        Modified_ByName = CkJsonObjectW_stringOf(jResp,L"data[i].Modified_By.name");
        Modified_ById = CkJsonObjectW_stringOf(jResp,L"data[i].Modified_By.id");
        Modified_ByEmail = CkJsonObjectW_stringOf(jResp,L"data[i].Modified_By.email");
        Sreview = CkJsonObjectW_stringOf(jResp,L"data[i].$review");
        Skype_ID = CkJsonObjectW_stringOf(jResp,L"data[i].Skype_ID");
        Phone = CkJsonObjectW_stringOf(jResp,L"data[i].Phone");
        HIPAA = CkJsonObjectW_stringOf(jResp,L"data[i].HIPAA");
        Email_Opt_Out = CkJsonObjectW_BoolOf(jResp,L"data[i].Email_Opt_Out");
        Designation = CkJsonObjectW_stringOf(jResp,L"data[i].Designation");
        Modified_Time = CkJsonObjectW_stringOf(jResp,L"data[i].Modified_Time");
        Unsubscribed_Time = CkJsonObjectW_stringOf(jResp,L"data[i].Unsubscribed_Time");
        Mobile = CkJsonObjectW_stringOf(jResp,L"data[i].Mobile");
        Sorchestration = CkJsonObjectW_BoolOf(jResp,L"data[i].$orchestration");
        Sstop_processing = CkJsonObjectW_BoolOf(jResp,L"data[i].$stop_processing");
        Last_Name = CkJsonObjectW_stringOf(jResp,L"data[i].Last_Name");
        Sin_merge = CkJsonObjectW_BoolOf(jResp,L"data[i].$in_merge");
        Lead_Source = CkJsonObjectW_stringOf(jResp,L"data[i].Lead_Source");
        Fax = CkJsonObjectW_stringOf(jResp,L"data[i].Fax");
        Sapproval_state = CkJsonObjectW_stringOf(jResp,L"data[i].$approval_state");
        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].Tag");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            j = j + 1;
        }

        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://domain.com/crm/v2/Leads/{{record_id}}

Postman Collection Item JSON

{
  "name": "Subforms",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{api-domain}}/crm/v2/Leads/{{record_id}}",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2",
        "Leads",
        "{{record_id}}"
      ]
    },
    "description": "To get the subform data in a record."
  },
  "response": [
    {
      "name": "SUCCESS RESPONSE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/738964000002131001",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "738964000002131001"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:16:36 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Transfer-Encoding",
          "value": "chunked"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-store, no-cache, must-revalidate, private"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-11T13:58:39+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4023320"
        },
        {
          "key": "clientsubVersion",
          "value": "4d8b6ee4f7d1d284c930a4e807480c5c"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "vary",
          "value": "accept-encoding"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=15768000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"Owner\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Company\": null,\n            \"Email\": null,\n            \"$currency_symbol\": \"Af\",\n            \"Interested_Leads\": null,\n            \"Last_Activity_Time\": \"2021-05-07T13:10:11+00:00\",\n            \"Industry\": null,\n            \"$state\": \"save\",\n            \"Unsubscribed_Mode\": null,\n            \"$converted\": false,\n            \"$process_flow\": false,\n            \"Exchange_Rate\": 1,\n            \"Currency\": \"AFN\",\n            \"Street\": null,\n            \"Zip_Code\": \"1234\",\n            \"Data_Processing_Basis_Details\": null,\n            \"id\": \"738964000002131001\",\n            \"Data_Source\": \"Manual\",\n            \"$approved\": true,\n            \"$approval\": {\n                \"delegate\": false,\n                \"approve\": false,\n                \"reject\": false,\n                \"resubmit\": false\n            },\n            \"$data_source_details\": null,\n            \"Created_Time\": \"2021-05-07T06:23:10+00:00\",\n            \"$editable\": true,\n            \"City\": null,\n            \"No_of_Employees\": 1000,\n            \"State\": \"Colorado\",\n            \"Country\": null,\n            \"Created_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Annual_Revenue\": 1,\n            \"Secondary_Email\": null,\n            \"Description\": null,\n            \"Rating\": null,\n            \"$review_process\": {\n                \"approve\": false,\n                \"reject\": false,\n                \"resubmit\": false\n            },\n            \"Website\": \"https://yaythisworked.com\",\n            \"Twitter\": null,\n            \"$canvas_id\": null,\n            \"Salutation\": null,\n            \"First_Name\": null,\n            \"Lead_Status\": null,\n            \"Full_Name\": \"sample\",\n            \"Record_Image\": null,\n            \"Modified_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"$review\": null,\n            \"Skype_ID\": null,\n            \"Phone\": null,\n            \"HIPAA\": null,\n            \"Email_Opt_Out\": false,\n            \"Designation\": null,\n            \"Modified_Time\": \"2021-05-07T13:10:11+00:00\",\n            \"$converted_detail\": {},\n            \"Unsubscribed_Time\": null,\n            \"Mobile\": \"9898989898\",\n            \"$orchestration\": false,\n            \"$stop_processing\": false,\n            \"Last_Name\": \"sample\",\n            \"$in_merge\": false,\n            \"Lead_Source\": null,\n            \"Tag\": [],\n            \"Fax\": null,\n            \"$approval_state\": \"approved\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_MODULE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2/Lead/738964000002131001",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Lead",
            "738964000002131001"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:16:54 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "110"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-store, no-cache, must-revalidate, private"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-11T13:58:39+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4023320"
        },
        {
          "key": "clientsubVersion",
          "value": "4d8b6ee4f7d1d284c930a4e807480c5c"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"INVALID_MODULE\",\n    \"details\": {},\n    \"message\": \"the module name given seems to be invalid\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "INVALID_REQUEST_METHOD",
      "originalRequest": {
        "method": "COPY",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/738964000002131001",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "738964000002131001"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:17:14 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "124"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "X-Frame-Options",
          "value": "deny"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"INVALID_REQUEST_METHOD\",\n    \"details\": {},\n    \"message\": \"The http request method type is not a valid one\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "AUTHENTICATION_FAILURE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/738964000002131001",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "738964000002131001"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:17:33 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "98"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"AUTHENTICATION_FAILURE\",\n    \"details\": {},\n    \"message\": \"Authentication failed\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "OAUTH_SCOPE_MISMATCH",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/{{record_id}}",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "{{record_id}}"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 06:35:48 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "113"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"OAUTH_SCOPE_MISMATCH\",\n    \"details\": {},\n    \"message\": \"invalid oauth scope to access this URL\",\n    \"status\": \"error\"\n}"
    }
  ]
}