Chilkat Online Tools

PureBasic / Zoho CRM REST APIs / Notes

Back to Collection Items

IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    ; Adds the "Authorization: Bearer <access_token>" header.
    CkHttp::setCkAuthToken(http, "<access_token>")

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkHttp::ckQuickGetSb(http,"https://domain.com/crm/v2/Leads/{{record_id}}/Notes",sbResponseBody)
    If success = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkStringBuilder::ckDispose(sbResponseBody)
        ProcedureReturn
    EndIf

    jResp.i = CkJsonObject::ckCreate()
    If jResp.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckLoadSb(jResp,sbResponseBody)
    CkJsonObject::setCkEmitCompact(jResp, 0)

    Debug "Response Body:"
    Debug CkJsonObject::ckEmit(jResp)

    respStatusCode.i = CkHttp::ckLastStatus(http)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode >= 400
        Debug "Response Header:"
        Debug CkHttp::ckLastHeader(http)
        Debug "Failed."
        CkHttp::ckDispose(http)
        CkStringBuilder::ckDispose(sbResponseBody)
        CkJsonObject::ckDispose(jResp)
        ProcedureReturn
    EndIf

    ; 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"
    ;       },
    ;       "Modified_Time": "2021-05-07T11:10:01+00:00",
    ;       "$attachments": null,
    ;       "Created_Time": "2021-05-07T11:08:30+00:00",
    ;       "Parent_Id": {
    ;         "name": "sample",
    ;         "id": "738964000002131001"
    ;       },
    ;       "$editable": true,
    ;       "$se_module": "Leads",
    ;       "$is_shared_to_client": false,
    ;       "Modified_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "$size": null,
    ;       "$state": "save",
    ;       "$voice_note": false,
    ;       "id": "738964000002130215",
    ;       "Created_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Note_Title": "Contacted",
    ;       "Note_Content": "Have to assign to a different user"
    ;     },
    ;     {
    ;       "Owner": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Modified_Time": "2021-05-07T11:08:22+00:00",
    ;       "$attachments": null,
    ;       "Created_Time": "2021-05-07T11:08:22+00:00",
    ;       "Parent_Id": {
    ;         "name": "sample",
    ;         "id": "738964000002131001"
    ;       },
    ;       "$editable": true,
    ;       "$se_module": "Leads",
    ;       "$is_shared_to_client": false,
    ;       "Modified_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "$size": null,
    ;       "$state": "save",
    ;       "$voice_note": false,
    ;       "id": "738964000002130210",
    ;       "Created_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Note_Title": "Contacted",
    ;       "Note_Content": "Need to do further tracking"
    ;     },
    ;     {
    ;       "Owner": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Modified_Time": "2021-05-07T11:06:20+00:00",
    ;       "$attachments": null,
    ;       "Created_Time": "2021-05-07T11:06:20+00:00",
    ;       "Parent_Id": {
    ;         "name": "sample",
    ;         "id": "738964000002131001"
    ;       },
    ;       "$editable": true,
    ;       "$se_module": "Leads",
    ;       "$is_shared_to_client": false,
    ;       "Modified_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "$size": null,
    ;       "$state": "save",
    ;       "$voice_note": false,
    ;       "id": "738964000002130205",
    ;       "Created_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Note_Title": "Contacted",
    ;       "Note_Content": "Need to do further tracking"
    ;     },
    ;     {
    ;       "Owner": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Modified_Time": "2021-05-07T11:05:34+00:00",
    ;       "$attachments": null,
    ;       "Created_Time": "2021-05-07T11:05:34+00:00",
    ;       "Parent_Id": {
    ;         "name": "sample",
    ;         "id": "738964000002131001"
    ;       },
    ;       "$editable": true,
    ;       "$se_module": "Leads",
    ;       "$is_shared_to_client": false,
    ;       "Modified_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "$size": null,
    ;       "$state": "save",
    ;       "$voice_note": false,
    ;       "id": "738964000002130200",
    ;       "Created_By": {
    ;         "name": "Patricia Boyle",
    ;         "id": "738964000000291009",
    ;         "email": "patricia.ss@zylker.com"
    ;       },
    ;       "Note_Title": "Contacted",
    ;       "Note_Content": "Need to do further tracking"
    ;     }
    ;   ],
    ;   "info": {
    ;     "per_page": 200,
    ;     "count": 4,
    ;     "page": 1,
    ;     "more_records": false
    ;   }
    ; }

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

    Name.s
    Id.s
    v_Email.s
    Modified_Time.s
    Sattachments.s
    Created_Time.s
    Parent_IdName.s
    Parent_IdId.s
    Seditable.i
    Sse_module.s
    Sis_shared_to_client.i
    Modified_ByName.s
    Modified_ById.s
    Modified_ByEmail.s
    Ssize.s
    Sstate.s
    Svoice_note.i
    id.s
    Created_ByName.s
    Created_ById.s
    Created_ByEmail.s
    Note_Title.s
    Note_Content.s

    Per_page.i = CkJsonObject::ckIntOf(jResp,"info.per_page")
    Count.i = CkJsonObject::ckIntOf(jResp,"info.count")
    Page.i = CkJsonObject::ckIntOf(jResp,"info.page")
    More_records.i = CkJsonObject::ckBoolOf(jResp,"info.more_records")
    i.i = 0
    count_i.i = CkJsonObject::ckSizeOfArray(jResp,"data")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        Name = CkJsonObject::ckStringOf(jResp,"data[i].Owner.name")
        Id = CkJsonObject::ckStringOf(jResp,"data[i].Owner.id")
        v_Email = CkJsonObject::ckStringOf(jResp,"data[i].Owner.email")
        Modified_Time = CkJsonObject::ckStringOf(jResp,"data[i].Modified_Time")
        Sattachments = CkJsonObject::ckStringOf(jResp,"data[i].$attachments")
        Created_Time = CkJsonObject::ckStringOf(jResp,"data[i].Created_Time")
        Parent_IdName = CkJsonObject::ckStringOf(jResp,"data[i].Parent_Id.name")
        Parent_IdId = CkJsonObject::ckStringOf(jResp,"data[i].Parent_Id.id")
        Seditable = CkJsonObject::ckBoolOf(jResp,"data[i].$editable")
        Sse_module = CkJsonObject::ckStringOf(jResp,"data[i].$se_module")
        Sis_shared_to_client = CkJsonObject::ckBoolOf(jResp,"data[i].$is_shared_to_client")
        Modified_ByName = CkJsonObject::ckStringOf(jResp,"data[i].Modified_By.name")
        Modified_ById = CkJsonObject::ckStringOf(jResp,"data[i].Modified_By.id")
        Modified_ByEmail = CkJsonObject::ckStringOf(jResp,"data[i].Modified_By.email")
        Ssize = CkJsonObject::ckStringOf(jResp,"data[i].$size")
        Sstate = CkJsonObject::ckStringOf(jResp,"data[i].$state")
        Svoice_note = CkJsonObject::ckBoolOf(jResp,"data[i].$voice_note")
        id = CkJsonObject::ckStringOf(jResp,"data[i].id")
        Created_ByName = CkJsonObject::ckStringOf(jResp,"data[i].Created_By.name")
        Created_ById = CkJsonObject::ckStringOf(jResp,"data[i].Created_By.id")
        Created_ByEmail = CkJsonObject::ckStringOf(jResp,"data[i].Created_By.email")
        Note_Title = CkJsonObject::ckStringOf(jResp,"data[i].Note_Title")
        Note_Content = CkJsonObject::ckStringOf(jResp,"data[i].Note_Content")
        i = i + 1
    Wend


    CkHttp::ckDispose(http)
    CkStringBuilder::ckDispose(sbResponseBody)
    CkJsonObject::ckDispose(jResp)


    ProcedureReturn
EndProcedure

Curl Command

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

Postman Collection Item JSON

{
  "name": "Notes",
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{api-domain}}/crm/v2/Leads/{{record_id}}/Notes",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2",
        "Leads",
        "{{record_id}}",
        "Notes"
      ]
    },
    "description": "To get the notes associated with a Lead"
  },
  "response": [
    {
      "name": "SUCCESS RESPONSE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/738964000002131001/Notes",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "738964000002131001",
            "Notes"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:22:44 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            \"Modified_Time\": \"2021-05-07T11:10:01+00:00\",\n            \"$attachments\": null,\n            \"Created_Time\": \"2021-05-07T11:08:30+00:00\",\n            \"Parent_Id\": {\n                \"name\": \"sample\",\n                \"id\": \"738964000002131001\"\n            },\n            \"$editable\": true,\n            \"$se_module\": \"Leads\",\n            \"$is_shared_to_client\": false,\n            \"Modified_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"$size\": null,\n            \"$state\": \"save\",\n            \"$voice_note\": false,\n            \"id\": \"738964000002130215\",\n            \"Created_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Note_Title\": \"Contacted\",\n            \"Note_Content\": \"Have to assign to a different user\"\n        },\n        {\n            \"Owner\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Modified_Time\": \"2021-05-07T11:08:22+00:00\",\n            \"$attachments\": null,\n            \"Created_Time\": \"2021-05-07T11:08:22+00:00\",\n            \"Parent_Id\": {\n                \"name\": \"sample\",\n                \"id\": \"738964000002131001\"\n            },\n            \"$editable\": true,\n            \"$se_module\": \"Leads\",\n            \"$is_shared_to_client\": false,\n            \"Modified_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"$size\": null,\n            \"$state\": \"save\",\n            \"$voice_note\": false,\n            \"id\": \"738964000002130210\",\n            \"Created_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Note_Title\": \"Contacted\",\n            \"Note_Content\": \"Need to do further tracking\"\n        },\n        {\n            \"Owner\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Modified_Time\": \"2021-05-07T11:06:20+00:00\",\n            \"$attachments\": null,\n            \"Created_Time\": \"2021-05-07T11:06:20+00:00\",\n            \"Parent_Id\": {\n                \"name\": \"sample\",\n                \"id\": \"738964000002131001\"\n            },\n            \"$editable\": true,\n            \"$se_module\": \"Leads\",\n            \"$is_shared_to_client\": false,\n            \"Modified_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"$size\": null,\n            \"$state\": \"save\",\n            \"$voice_note\": false,\n            \"id\": \"738964000002130205\",\n            \"Created_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Note_Title\": \"Contacted\",\n            \"Note_Content\": \"Need to do further tracking\"\n        },\n        {\n            \"Owner\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Modified_Time\": \"2021-05-07T11:05:34+00:00\",\n            \"$attachments\": null,\n            \"Created_Time\": \"2021-05-07T11:05:34+00:00\",\n            \"Parent_Id\": {\n                \"name\": \"sample\",\n                \"id\": \"738964000002131001\"\n            },\n            \"$editable\": true,\n            \"$se_module\": \"Leads\",\n            \"$is_shared_to_client\": false,\n            \"Modified_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"$size\": null,\n            \"$state\": \"save\",\n            \"$voice_note\": false,\n            \"id\": \"738964000002130200\",\n            \"Created_By\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\",\n                \"email\": \"patricia.ss@zylker.com\"\n            },\n            \"Note_Title\": \"Contacted\",\n            \"Note_Content\": \"Need to do further tracking\"\n        }\n    ],\n    \"info\": {\n        \"per_page\": 200,\n        \"count\": 4,\n        \"page\": 1,\n        \"more_records\": false\n    }\n}\n}"
    },
    {
      "name": "INVALID_MODULE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/Lead/738964000002131001/Notes",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Lead",
            "738964000002131001",
            "Notes"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:23:52 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": [
        ],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/Lead/738964000002131001/Notes",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Lead",
            "738964000002131001",
            "Notes"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:26:31 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": [
        ],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/Lead/738964000002131001/Notes",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Lead",
            "738964000002131001",
            "Notes"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Tue, 11 May 2021 13:26:47 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": [
        ],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/Leads/{{record_id}}/Notes",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "Leads",
            "{{record_id}}",
            "Notes"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 06:36:12 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}"
    }
  ]
}