DataFlex / Zoho CRM REST APIs / Deleting the records using the "ids" parameter
        
        Back to Collection Items
        Use ChilkatAx-win32.pkg
Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.
    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End
    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"
    Send ComSetRequestHeader To hoHttp "X-EXTERNAL" "Contacts.External_Contact_ID"
    Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
    If (Not(IsComObjectCreated(hoResp))) Begin
        Send CreateComObject of hoResp
    End
    Get pvComObject of hoResp to vResp
    Get ComHttpNoBody Of hoHttp "DELETE" "https://domain.com/crm/v2/Contacts?ids=extcontact3,extcontact4" vResp To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End
    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
End_Procedure
        Curl Command
        curl -X DELETE
	-H "Authorization: Bearer <access_token>"
	-H "X-EXTERNAL: Contacts.External_Contact_ID"
https://domain.com/crm/v2/Contacts?ids=extcontact3,extcontact4
        Postman Collection Item JSON
        {
  "name": "Deleting the records using the \"ids\" parameter",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
      {
        "key": "X-EXTERNAL",
        "value": "Contacts.External_Contact_ID",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{api-domain}}/crm/v2/Contacts?ids=extcontact3,extcontact4",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2",
        "Contacts"
      ],
      "query": [
        {
          "key": "ids",
          "value": "extcontact3,extcontact4"
        }
      ]
    },
    "description": "In this example, we have used the \"ids\" parameter with values as the values of the external field in the Contacts module."
  },
  "response": [
  ]
}