Chilkat Online Tools

SQL Server / Zoho CRM REST APIs / Subforms

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    -- Adds the "Authorization: Bearer <access_token>" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'

    DECLARE @sbResponseBody int
    -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://domain.com/crm/v2/Leads/{{record_id}}', @sbResponseBody
    IF @success = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END

    DECLARE @jResp int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END

    -- 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

    DECLARE @Name nvarchar(4000)

    DECLARE @Id nvarchar(4000)

    DECLARE @v_Email nvarchar(4000)

    DECLARE @Company nvarchar(4000)

    DECLARE @Scurrency_symbol nvarchar(4000)

    DECLARE @Interested_Leads nvarchar(4000)

    DECLARE @Last_Activity_Time nvarchar(4000)

    DECLARE @Industry nvarchar(4000)

    DECLARE @Sstate nvarchar(4000)

    DECLARE @Unsubscribed_Mode nvarchar(4000)

    DECLARE @Sconverted int

    DECLARE @Sprocess_flow int

    DECLARE @Exchange_Rate int

    DECLARE @v_Currency nvarchar(4000)

    DECLARE @Street nvarchar(4000)

    DECLARE @Zip_Code nvarchar(4000)

    DECLARE @Data_Processing_Basis_Details nvarchar(4000)

    DECLARE @id nvarchar(4000)

    DECLARE @Data_Source nvarchar(4000)

    DECLARE @Sapproved int

    DECLARE @Delegate int

    DECLARE @Approve int

    DECLARE @Reject int

    DECLARE @Resubmit int

    DECLARE @Sdata_source_details nvarchar(4000)

    DECLARE @Created_Time nvarchar(4000)

    DECLARE @Seditable int

    DECLARE @City nvarchar(4000)

    DECLARE @No_of_Employees int

    DECLARE @State nvarchar(4000)

    DECLARE @Country nvarchar(4000)

    DECLARE @Created_ByName nvarchar(4000)

    DECLARE @Created_ById nvarchar(4000)

    DECLARE @Created_ByEmail nvarchar(4000)

    DECLARE @Annual_Revenue int

    DECLARE @Secondary_Email nvarchar(4000)

    DECLARE @Description nvarchar(4000)

    DECLARE @Rating nvarchar(4000)

    DECLARE @Sreview_processApprove int

    DECLARE @Sreview_processReject int

    DECLARE @Sreview_processResubmit int

    DECLARE @Website nvarchar(4000)

    DECLARE @Twitter nvarchar(4000)

    DECLARE @Scanvas_id nvarchar(4000)

    DECLARE @Salutation nvarchar(4000)

    DECLARE @First_Name nvarchar(4000)

    DECLARE @Lead_Status nvarchar(4000)

    DECLARE @Full_Name nvarchar(4000)

    DECLARE @Record_Image nvarchar(4000)

    DECLARE @Modified_ByName nvarchar(4000)

    DECLARE @Modified_ById nvarchar(4000)

    DECLARE @Modified_ByEmail nvarchar(4000)

    DECLARE @Sreview nvarchar(4000)

    DECLARE @Skype_ID nvarchar(4000)

    DECLARE @Phone nvarchar(4000)

    DECLARE @HIPAA nvarchar(4000)

    DECLARE @Email_Opt_Out int

    DECLARE @Designation nvarchar(4000)

    DECLARE @Modified_Time nvarchar(4000)

    DECLARE @Unsubscribed_Time nvarchar(4000)

    DECLARE @Mobile nvarchar(4000)

    DECLARE @Sorchestration int

    DECLARE @Sstop_processing int

    DECLARE @Last_Name nvarchar(4000)

    DECLARE @Sin_merge int

    DECLARE @Lead_Source nvarchar(4000)

    DECLARE @Fax nvarchar(4000)

    DECLARE @Sapproval_state nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @Name OUT, 'data[i].Owner.name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'data[i].Owner.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Email OUT, 'data[i].Owner.email'
        EXEC sp_OAMethod @jResp, 'StringOf', @Company OUT, 'data[i].Company'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Email OUT, 'data[i].Email'
        EXEC sp_OAMethod @jResp, 'StringOf', @Scurrency_symbol OUT, 'data[i].$currency_symbol'
        EXEC sp_OAMethod @jResp, 'StringOf', @Interested_Leads OUT, 'data[i].Interested_Leads'
        EXEC sp_OAMethod @jResp, 'StringOf', @Last_Activity_Time OUT, 'data[i].Last_Activity_Time'
        EXEC sp_OAMethod @jResp, 'StringOf', @Industry OUT, 'data[i].Industry'
        EXEC sp_OAMethod @jResp, 'StringOf', @Sstate OUT, 'data[i].$state'
        EXEC sp_OAMethod @jResp, 'StringOf', @Unsubscribed_Mode OUT, 'data[i].Unsubscribed_Mode'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sconverted OUT, 'data[i].$converted'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sprocess_flow OUT, 'data[i].$process_flow'
        EXEC sp_OAMethod @jResp, 'IntOf', @Exchange_Rate OUT, 'data[i].Exchange_Rate'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Currency OUT, 'data[i].Currency'
        EXEC sp_OAMethod @jResp, 'StringOf', @Street OUT, 'data[i].Street'
        EXEC sp_OAMethod @jResp, 'StringOf', @Zip_Code OUT, 'data[i].Zip_Code'
        EXEC sp_OAMethod @jResp, 'StringOf', @Data_Processing_Basis_Details OUT, 'data[i].Data_Processing_Basis_Details'
        EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'data[i].id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Data_Source OUT, 'data[i].Data_Source'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sapproved OUT, 'data[i].$approved'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Delegate OUT, 'data[i].$approval.delegate'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Approve OUT, 'data[i].$approval.approve'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Reject OUT, 'data[i].$approval.reject'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Resubmit OUT, 'data[i].$approval.resubmit'
        EXEC sp_OAMethod @jResp, 'StringOf', @Sdata_source_details OUT, 'data[i].$data_source_details'
        EXEC sp_OAMethod @jResp, 'StringOf', @Created_Time OUT, 'data[i].Created_Time'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Seditable OUT, 'data[i].$editable'
        EXEC sp_OAMethod @jResp, 'StringOf', @City OUT, 'data[i].City'
        EXEC sp_OAMethod @jResp, 'IntOf', @No_of_Employees OUT, 'data[i].No_of_Employees'
        EXEC sp_OAMethod @jResp, 'StringOf', @State OUT, 'data[i].State'
        EXEC sp_OAMethod @jResp, 'StringOf', @Country OUT, 'data[i].Country'
        EXEC sp_OAMethod @jResp, 'StringOf', @Created_ByName OUT, 'data[i].Created_By.name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Created_ById OUT, 'data[i].Created_By.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Created_ByEmail OUT, 'data[i].Created_By.email'
        EXEC sp_OAMethod @jResp, 'IntOf', @Annual_Revenue OUT, 'data[i].Annual_Revenue'
        EXEC sp_OAMethod @jResp, 'StringOf', @Secondary_Email OUT, 'data[i].Secondary_Email'
        EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'data[i].Description'
        EXEC sp_OAMethod @jResp, 'StringOf', @Rating OUT, 'data[i].Rating'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processApprove OUT, 'data[i].$review_process.approve'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processReject OUT, 'data[i].$review_process.reject'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processResubmit OUT, 'data[i].$review_process.resubmit'
        EXEC sp_OAMethod @jResp, 'StringOf', @Website OUT, 'data[i].Website'
        EXEC sp_OAMethod @jResp, 'StringOf', @Twitter OUT, 'data[i].Twitter'
        EXEC sp_OAMethod @jResp, 'StringOf', @Scanvas_id OUT, 'data[i].$canvas_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Salutation OUT, 'data[i].Salutation'
        EXEC sp_OAMethod @jResp, 'StringOf', @First_Name OUT, 'data[i].First_Name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Lead_Status OUT, 'data[i].Lead_Status'
        EXEC sp_OAMethod @jResp, 'StringOf', @Full_Name OUT, 'data[i].Full_Name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Record_Image OUT, 'data[i].Record_Image'
        EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ByName OUT, 'data[i].Modified_By.name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ById OUT, 'data[i].Modified_By.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ByEmail OUT, 'data[i].Modified_By.email'
        EXEC sp_OAMethod @jResp, 'StringOf', @Sreview OUT, 'data[i].$review'
        EXEC sp_OAMethod @jResp, 'StringOf', @Skype_ID OUT, 'data[i].Skype_ID'
        EXEC sp_OAMethod @jResp, 'StringOf', @Phone OUT, 'data[i].Phone'
        EXEC sp_OAMethod @jResp, 'StringOf', @HIPAA OUT, 'data[i].HIPAA'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Email_Opt_Out OUT, 'data[i].Email_Opt_Out'
        EXEC sp_OAMethod @jResp, 'StringOf', @Designation OUT, 'data[i].Designation'
        EXEC sp_OAMethod @jResp, 'StringOf', @Modified_Time OUT, 'data[i].Modified_Time'
        EXEC sp_OAMethod @jResp, 'StringOf', @Unsubscribed_Time OUT, 'data[i].Unsubscribed_Time'
        EXEC sp_OAMethod @jResp, 'StringOf', @Mobile OUT, 'data[i].Mobile'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sorchestration OUT, 'data[i].$orchestration'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sstop_processing OUT, 'data[i].$stop_processing'
        EXEC sp_OAMethod @jResp, 'StringOf', @Last_Name OUT, 'data[i].Last_Name'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sin_merge OUT, 'data[i].$in_merge'
        EXEC sp_OAMethod @jResp, 'StringOf', @Lead_Source OUT, 'data[i].Lead_Source'
        EXEC sp_OAMethod @jResp, 'StringOf', @Fax OUT, 'data[i].Fax'
        EXEC sp_OAMethod @jResp, 'StringOf', @Sapproval_state OUT, 'data[i].$approval_state'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'data[i].Tag'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

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}"
    }
  ]
}