unicodeC / Zoho CRM REST APIs / Deleting the records using the "ids" parameter
Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkHttpResponseW resp;
// 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>");
CkHttpW_SetRequestHeader(http,L"X-EXTERNAL",L"Contacts.External_Contact_ID");
resp = CkHttpResponseW_Create();
success = CkHttpW_HttpNoBody(http,L"DELETE",L"https://domain.com/crm/v2/Contacts?ids=extcontact3,extcontact4",resp);
if (success == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
CkHttpResponseW_Dispose(resp);
return;
}
wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
CkHttpW_Dispose(http);
CkHttpResponseW_Dispose(resp);
}
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": [
]
}