Chilkat Online Tools

unicodeCpp / Zoho CRM REST APIs / Leads

Back to Collection Items

#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>
#include <CkStringBuilderW.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;
    bool success;

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "tags": [
    //     {
    //       "name": "Nurturing Lead"
    //     },
    //     {
    //       "name": "Qualifies Lead"
    //     }
    //   ]
    // }

    CkJsonObjectW json;
    json.UpdateString(L"tags[0].name",L"Nurturing Lead");
    json.UpdateString(L"tags[1].name",L"Qualifies Lead");

    // Adds the "Authorization: Bearer <access_token>" header.
    http.put_AuthToken(L"<access_token>");

    CkHttpResponseW *resp = http.PostJson3(L"https://domain.com/crm/v2/settings/tags?module=Leads",L"application/json",json);
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    CkStringBuilderW sbResponseBody;
    resp->GetBodySb(sbResponseBody);

    CkJsonObjectW jResp;
    jResp.LoadSb(sbResponseBody);
    jResp.put_EmitCompact(false);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",jResp.emit());

    int respStatusCode = resp->get_StatusCode();
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",resp->header());
        wprintf(L"Failed.\n");
        delete resp;
        return;
    }

    delete resp;

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "tags": [
    //     {
    //       "created_time": "2021-05-07T12:40:30+00:00",
    //       "modified_time": "2021-05-07T12:40:30+00:00",
    //       "name": "test",
    //       "modified_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       },
    //       "id": "738964000002130345",
    //       "created_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       }
    //     },
    //     {
    //       "created_time": "2021-05-12T06:33:15+00:00",
    //       "modified_time": "2021-05-12T06:33:15+00:00",
    //       "name": "Nurturing Lead2",
    //       "modified_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       },
    //       "id": "738964000002152055",
    //       "created_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       }
    //     },
    //     {
    //       "created_time": "2021-05-12T06:33:15+00:00",
    //       "modified_time": "2021-05-12T06:33:15+00:00",
    //       "name": "Qualifies Lead2",
    //       "modified_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       },
    //       "id": "738964000002152056",
    //       "created_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       }
    //     },
    //     {
    //       "created_time": "2021-05-12T06:42:36+00:00",
    //       "modified_time": "2021-05-12T06:42:36+00:00",
    //       "name": "Tag1",
    //       "modified_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       },
    //       "id": "738964000002152073",
    //       "created_by": {
    //         "name": "Patricia Boyle",
    //         "id": "738964000000291009"
    //       }
    //     }
    //   ],
    //   "info": {
    //     "count": 4,
    //     "allowed_count": 100
    //   }
    // }

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

    const wchar_t *created_time = 0;
    const wchar_t *modified_time = 0;
    const wchar_t *name = 0;
    const wchar_t *Name = 0;
    const wchar_t *Id = 0;
    const wchar_t *id = 0;
    const wchar_t *created_byName = 0;
    const wchar_t *created_byId = 0;

    int Count = jResp.IntOf(L"info.count");
    int Allowed_count = jResp.IntOf(L"info.allowed_count");
    int i = 0;
    int count_i = jResp.SizeOfArray(L"tags");
    while (i < count_i) {
        jResp.put_I(i);
        created_time = jResp.stringOf(L"tags[i].created_time");
        modified_time = jResp.stringOf(L"tags[i].modified_time");
        name = jResp.stringOf(L"tags[i].name");
        Name = jResp.stringOf(L"tags[i].modified_by.name");
        Id = jResp.stringOf(L"tags[i].modified_by.id");
        id = jResp.stringOf(L"tags[i].id");
        created_byName = jResp.stringOf(L"tags[i].created_by.name");
        created_byId = jResp.stringOf(L"tags[i].created_by.id");
        i = i + 1;
    }
    }

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-d '{
    "tags": [
        {
            "name": "Nurturing Lead"
        },
        {
            "name": "Qualifies Lead"
        }
    ]
}'
https://domain.com/crm/v2/settings/tags?module=Leads

Postman Collection Item JSON

{
  "name": "Leads",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "POST",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2",
        "settings",
        "tags"
      ],
      "query": [
        {
          "key": "module",
          "value": "Leads"
        }
      ]
    },
    "description": "To create new tags."
  },
  "response": [
    {
      "name": "P1: module",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 09:05:00 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-13T09:52:40+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4031107"
        },
        {
          "key": "clientsubVersion",
          "value": "113b962796fc62946d9303284a64efab"
        },
        {
          "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    \"tags\": [\n        {\n            \"created_time\": \"2021-05-07T12:40:30+00:00\",\n            \"modified_time\": \"2021-05-07T12:40:30+00:00\",\n            \"name\": \"test\",\n            \"modified_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            },\n            \"id\": \"738964000002130345\",\n            \"created_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            }\n        },\n        {\n            \"created_time\": \"2021-05-12T06:33:15+00:00\",\n            \"modified_time\": \"2021-05-12T06:33:15+00:00\",\n            \"name\": \"Nurturing Lead2\",\n            \"modified_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            },\n            \"id\": \"738964000002152055\",\n            \"created_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            }\n        },\n        {\n            \"created_time\": \"2021-05-12T06:33:15+00:00\",\n            \"modified_time\": \"2021-05-12T06:33:15+00:00\",\n            \"name\": \"Qualifies Lead2\",\n            \"modified_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            },\n            \"id\": \"738964000002152056\",\n            \"created_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            }\n        },\n        {\n            \"created_time\": \"2021-05-12T06:42:36+00:00\",\n            \"modified_time\": \"2021-05-12T06:42:36+00:00\",\n            \"name\": \"Tag1\",\n            \"modified_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            },\n            \"id\": \"738964000002152073\",\n            \"created_by\": {\n                \"name\": \"Patricia Boyle\",\n                \"id\": \"738964000000291009\"\n            }\n        }\n    ],\n    \"info\": {\n        \"count\": 4,\n        \"allowed_count\": 100\n    }\n}"
    },
    {
      "name": "SUCCESS RESPONSE",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead2\"\n        },\n        {\n            \"name\": \"Qualifies Lead2\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:33:09 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "674"
        },
        {
          "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-12T07:15:06+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4027076"
        },
        {
          "key": "clientsubVersion",
          "value": "748ecbe82ec7e144b66ee25f264bbd88"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=15768000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"tags\": [\n        {\n            \"code\": \"SUCCESS\",\n            \"details\": {\n                \"created_time\": \"2021-05-12T06:33:15+00:00\",\n                \"modified_time\": \"2021-05-12T06:33:15+00:00\",\n                \"modified_by\": {\n                    \"name\": \"Patricia Boyle\",\n                    \"id\": \"738964000000291009\"\n                },\n                \"id\": \"738964000002152055\",\n                \"created_by\": {\n                    \"name\": \"Patricia Boyle\",\n                    \"id\": \"738964000000291009\"\n                }\n            },\n            \"message\": \"tags created successfully\",\n            \"status\": \"success\"\n        },\n        {\n            \"code\": \"SUCCESS\",\n            \"details\": {\n                \"created_time\": \"2021-05-12T06:33:15+00:00\",\n                \"modified_time\": \"2021-05-12T06:33:15+00:00\",\n                \"modified_by\": {\n                    \"name\": \"Patricia Boyle\",\n                    \"id\": \"738964000000291009\"\n                },\n                \"id\": \"738964000002152056\",\n                \"created_by\": {\n                    \"name\": \"Patricia Boyle\",\n                    \"id\": \"738964000000291009\"\n                }\n            },\n            \"message\": \"tags created successfully\",\n            \"status\": \"success\"\n        }\n    ]\n}"
    },
    {
      "name": "DUPLICATE_DATA",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:32:54 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "262"
        },
        {
          "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-12T07:15:06+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4027076"
        },
        {
          "key": "clientsubVersion",
          "value": "748ecbe82ec7e144b66ee25f264bbd88"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=15768000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"tags\": [\n        {\n            \"code\": \"DUPLICATE_DATA\",\n            \"details\": {\n                \"api_name\": \"name\",\n                \"id\": \"738964000002130339\"\n            },\n            \"message\": \"duplicate data\",\n            \"status\": \"error\"\n        },\n        {\n            \"code\": \"DUPLICATE_DATA\",\n            \"details\": {\n                \"api_name\": \"name\",\n                \"id\": \"738964000002130340\"\n            },\n            \"message\": \"duplicate data\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_MODULE",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Lead",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Lead"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:33:36 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-12T07:15:06+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4027076"
        },
        {
          "key": "clientsubVersion",
          "value": "748ecbe82ec7e144b66ee25f264bbd88"
        },
        {
          "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": "REQUIRED_PARAM_MISSING",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:33:48 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "133"
        },
        {
          "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": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"REQUIRED_PARAM_MISSING\",\n    \"details\": {\n        \"param\": \"module\"\n    },\n    \"message\": \"One of the expected parameter is missing\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "INVALID_REQUEST_METHOD",
      "originalRequest": {
        "method": "COPY",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:34:11 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    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:34:24 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": "MANDATORY_NOT_FOUND",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n           \n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:34:55 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "125"
        },
        {
          "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-12T07:15:06+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4027076"
        },
        {
          "key": "clientsubVersion",
          "value": "748ecbe82ec7e144b66ee25f264bbd88"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=15768000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"tags\": [\n        {\n            \"code\": \"MANDATORY_NOT_FOUND\",\n            \"details\": {\n                \"api_name\": \"name\"\n            },\n            \"message\": \"required field not found\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_DATA",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": $$$\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Wed, 12 May 2021 06:35:13 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "136"
        },
        {
          "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-12T07:15:06+00:00"
        },
        {
          "key": "clientVersion",
          "value": "4027076"
        },
        {
          "key": "clientsubVersion",
          "value": "748ecbe82ec7e144b66ee25f264bbd88"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=15768000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"tags\": [\n        {\n            \"code\": \"INVALID_DATA\",\n            \"details\": {\n                \"api_name\": \"name\"\n            },\n            \"message\": \"special characters found in the given name\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "OAUTH_SCOPE_MISMATCH",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"tags\": [\n        {\n            \"name\": \"Nurturing Lead\"\n        },\n        {\n            \"name\": \"Qualifies Lead\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2/settings/tags?module=Leads",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2",
            "settings",
            "tags"
          ],
          "query": [
            {
              "key": "module",
              "value": "Leads"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 08:32:16 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}"
    }
  ]
}