Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
#include <C_CkStringBuilder.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkJsonObject json;
HCkHttpResponse resp;
HCkStringBuilder sbResponseBody;
HCkJsonObject jResp;
int respStatusCode;
const char *code;
const char *Id;
const char *message;
const char *status;
int i;
int count_i;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "data": [
// {
// "id": "{{record_ID1}}",
// "Territories": [
// {
// "id": "{{territory_ID1}}"
// },
// {
// "id": "{{territory_ID2}}"
// }
// ]
// },
// {
// "id": "{{record_ID2}}",
// "Territories": [
// {
// "id": "{{territory_ID1}}"
// },
// {
// "id": "{{territory_ID2}}"
// }
// ]
// }
// ]
// }
json = CkJsonObject_Create();
CkJsonObject_UpdateString(json,"data[0].id","{{record_ID1}}");
CkJsonObject_UpdateString(json,"data[0].Territories[0].id","{{territory_ID1}}");
CkJsonObject_UpdateString(json,"data[0].Territories[1].id","{{territory_ID2}}");
CkJsonObject_UpdateString(json,"data[1].id","{{record_ID2}}");
CkJsonObject_UpdateString(json,"data[1].Territories[0].id","{{territory_ID1}}");
CkJsonObject_UpdateString(json,"data[1].Territories[1].id","{{territory_ID2}}");
// Adds the "Authorization: Bearer <access_token>" header.
CkHttp_putAuthToken(http,"<access_token>");
resp = CkHttp_PostJson3(http,"https://domain.com/crm/v2.1/Accounts/actions/remove_territories","application/json",json);
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
return;
}
sbResponseBody = CkStringBuilder_Create();
CkHttpResponse_GetBodySb(resp,sbResponseBody);
jResp = CkJsonObject_Create();
CkJsonObject_LoadSb(jResp,sbResponseBody);
CkJsonObject_putEmitCompact(jResp,FALSE);
printf("Response Body:\n");
printf("%s\n",CkJsonObject_emit(jResp));
respStatusCode = CkHttpResponse_getStatusCode(resp);
printf("Response Status Code = %d\n",respStatusCode);
if (respStatusCode >= 400) {
printf("Response Header:\n");
printf("%s\n",CkHttpResponse_header(resp));
printf("Failed.\n");
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);
return;
}
CkHttpResponse_Dispose(resp);
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "data": [
// {
// "code": "SUCCESS",
// "details": {
// "id": "4150868000004818104"
// },
// "message": "the terriroies data removed successfully",
// "status": "success"
// },
// {
// "code": "SUCCESS",
// "details": {
// "id": "4150868000004818029"
// },
// "message": "the terriroies data removed successfully",
// "status": "success"
// }
// ]
// }
// 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 = CkJsonObject_SizeOfArray(jResp,"data");
while (i < count_i) {
CkJsonObject_putI(jResp,i);
code = CkJsonObject_stringOf(jResp,"data[i].code");
Id = CkJsonObject_stringOf(jResp,"data[i].details.id");
message = CkJsonObject_stringOf(jResp,"data[i].message");
status = CkJsonObject_stringOf(jResp,"data[i].status");
i = i + 1;
}
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);
}
Curl Command
curl -X POST
-H "Authorization: Bearer <access_token>"
-d '{
"data": [
{
"id": "{{record_ID1}}",
"Territories": [
{
"id": "{{territory_ID1}}"
},
{
"id": "{{territory_ID2}}"
}
]
},
{
"id": "{{record_ID2}}",
"Territories": [
{
"id": "{{territory_ID1}}"
},
{
"id": "{{territory_ID2}}"
}
]
}
]
}'
https://domain.com/crm/v2.1/Accounts/actions/remove_territories
Postman Collection Item JSON
{
"name": "Remove Territories",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access-token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"{{record_ID1}}\",\n \"Territories\": [\n {\n \"id\": \"{{territory_ID1}}\"\n },\n {\n \"id\": \"{{territory_ID2}}\"\n }\n ]\n },\n {\n \"id\": \"{{record_ID2}}\",\n \"Territories\": [\n {\n \"id\": \"{{territory_ID1}}\"\n },\n {\n \"id\": \"{{territory_ID2}}\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
},
"description": "To remove territories assigned to multiple records or a single record."
},
"response": [
{
"name": "SUCCESS RESPONSE",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n },\n {\n \"id\": \"4150868000004818029\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Contacts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Contacts",
"actions",
"remove_territories"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:23:20 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "270"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"SUCCESS\",\n \"details\": {\n \"id\": \"4150868000004818104\"\n },\n \"message\": \"the terriroies data removed successfully\",\n \"status\": \"success\"\n },\n {\n \"code\": \"SUCCESS\",\n \"details\": {\n \"id\": \"4150868000004818029\"\n },\n \"message\": \"the terriroies data removed successfully\",\n \"status\": \"success\"\n }\n ]\n}"
},
{
"name": "OAUTH_SCOPE_MISMATCH",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n },\n {\n \"id\": \"4150868000004818029\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:13:27 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}"
},
{
"name": "INVALID_REQUEST_METHOD",
"originalRequest": {
"method": "GET",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n },\n {\n \"id\": \"4150868000004818029\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:16:22 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": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n },\n {\n \"id\": \"4150868000004818029\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:16:44 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": "INVALID_DATA (Record ID)",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n },\n {\n \"id\": \"4150868000004818029\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:18:38 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "306"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"INVALID_DATA\",\n \"details\": {\n \"api_name\": \"id\",\n \"json_path\": \"$.data[0].id\"\n },\n \"message\": \"The record Id given seems to be invalid\",\n \"status\": \"error\"\n },\n {\n \"code\": \"INVALID_DATA\",\n \"details\": {\n \"api_name\": \"id\",\n \"json_path\": \"$.data[1].id\"\n },\n \"message\": \"The record Id given seems to be invalid\",\n \"status\": \"error\"\n }\n ]\n}"
},
{
"name": "INVALID_DATA (Territory ID)",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": [\n {\n \"id\": \"415086800000325900\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Contacts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Contacts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:23:45 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "166"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"INVALID_DATA\",\n \"details\": {\n \"api_name\": \"id\",\n \"json_path\": \"$.data[0].Territories[0].id\"\n },\n \"message\": \"the id given seems to be invalid\",\n \"status\": \"error\"\n }\n ]\n}"
},
{
"name": "NOT_ALLOWED",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000003247001\",\n \"Territories\": [\n {\n \"id\": \"4150868000003259003\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Accounts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Accounts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:20:28 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "196"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"NOT_ALLOWED\",\n \"details\": {\n \"api_name\": \"id\",\n \"json_path\": \"$.data[0].Territories[0].id\"\n },\n \"message\": \"Territory id which you are trying to remove was system assigned\",\n \"status\": \"error\"\n }\n ]\n}"
},
{
"name": "MANDATORY_NOT_FOUND (Record ID)",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"Territories\": [\n {\n \"id\": \"415086800000325900\"\n },\n {\n \"id\": \"4150868000001390007\"\n }\n ]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Contacts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Contacts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:24:17 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "166"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"MANDATORY_NOT_FOUND\",\n \"details\": {\n \"api_name\": \"id\",\n \"json_path\": \"$.data[0].id\"\n },\n \"message\": \"One of the expected parameter is missing\",\n \"status\": \"error\"\n }\n ]\n}"
},
{
"name": "MANDATORY_NOT_FOUND (Territory ID)",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"data\": [\n {\n \"id\": \"4150868000004818104\",\n \"Territories\": []\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Contacts/actions/remove_territories",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Contacts",
"actions",
"remove_territories"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Mon, 03 May 2021 11:24:41 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "168"
},
{
"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": "Set-Cookie",
"value": "listview_enabled=true;Path=/"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-03T17:48:32+05:30"
},
{
"key": "clientVersion",
"value": "4000204"
},
{
"key": "clientsubVersion",
"value": "9875f452294f1c73e02cebb497ee077e"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"code\": \"MANDATORY_NOT_FOUND\",\n \"details\": {\n \"api_name\": \"Territories\",\n \"json_path\": \"$.data[0].Territories\"\n },\n \"message\": \"required field not found\",\n \"status\": \"error\"\n }\n ]\n}"
}
]
}