Chilkat Online Tools

unicodeC / Zoho CRM REST APIs / Pipeline

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW queryParams;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *display_value;
    BOOL default;
    const wchar_t *actual_value;
    const wchar_t *id;
    int j;
    int count_j;
    int sequence_number;
    const wchar_t *Name;
    const wchar_t *Id;
    const wchar_t *forecast_type;
    int i;
    int count_i;

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

    http = CkHttpW_Create();

    queryParams = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(queryParams,L"layout_id",L"{{layout_id}}");

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

    resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://domain.com/crm/v2.1/settings/pipeline",queryParams);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

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

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

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

    // {
    //   "pipeline": [
    //     {
    //       "display_value": "Standard (Standard)",
    //       "default": false,
    //       "maps": [
    //         {
    //           "display_value": "Qualification",
    //           "sequence_number": 1,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Qualification",
    //           "id": "738964000000007104",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Needs Analysis",
    //           "sequence_number": 2,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Needs Analysis",
    //           "id": "738964000000007106",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Value Proposition",
    //           "sequence_number": 3,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Value Proposition",
    //           "id": "738964000000007108",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Identify Decision Makers",
    //           "sequence_number": 4,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Id. Decision Makers",
    //           "id": "738964000000007110",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Proposal/Price Quote",
    //           "sequence_number": 5,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Proposal/Price Quote",
    //           "id": "738964000000007112",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Negotiation/Review",
    //           "sequence_number": 6,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Negotiation/Review",
    //           "id": "738964000000007114",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Closed Won",
    //           "sequence_number": 7,
    //           "forecast_category": {
    //             "name": "Closed",
    //             "id": "738964000000007094"
    //           },
    //           "actual_value": "Closed Won",
    //           "id": "738964000000007116",
    //           "forecast_type": "Closed Won"
    //         },
    //         {
    //           "display_value": "Closed Lost",
    //           "sequence_number": 8,
    //           "forecast_category": {
    //             "name": "Omitted",
    //             "id": "738964000000007096"
    //           },
    //           "actual_value": "Closed Lost",
    //           "id": "738964000000007118",
    //           "forecast_type": "Closed Lost"
    //         },
    //         {
    //           "display_value": "Closed-Lost to Competition",
    //           "sequence_number": 9,
    //           "forecast_category": {
    //             "name": "Omitted",
    //             "id": "738964000000007096"
    //           },
    //           "actual_value": "Closed Lost to Competition",
    //           "id": "738964000000007120",
    //           "forecast_type": "Closed Lost"
    //         },
    //         {
    //           "display_value": "Start",
    //           "sequence_number": 10,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Start",
    //           "id": "738964000002131043",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Discount Approved",
    //           "sequence_number": 11,
    //           "forecast_category": {
    //             "name": "Closed",
    //             "id": "738964000000007094"
    //           },
    //           "actual_value": "Discount Approved",
    //           "id": "738964000002131049",
    //           "forecast_type": "Closed Won"
    //         },
    //         {
    //           "display_value": "Discount Rejected",
    //           "sequence_number": 12,
    //           "forecast_category": {
    //             "name": "Omitted",
    //             "id": "738964000000007096"
    //           },
    //           "actual_value": "Discount Rejected",
    //           "id": "738964000002131055",
    //           "forecast_type": "Closed Lost"
    //         },
    //         {
    //           "display_value": "Contract Sent",
    //           "sequence_number": 13,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Contract Sent",
    //           "id": "738964000002131061",
    //           "forecast_type": "Open"
    //         }
    //       ],
    //       "actual_value": "Standard (Standard)",
    //       "id": "738964000001920858"
    //     },
    //     {
    //       "display_value": "sample",
    //       "default": true,
    //       "maps": [
    //         {
    //           "display_value": "Qualification",
    //           "sequence_number": 1,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Qualification",
    //           "id": "738964000000007104",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Needs Analysis",
    //           "sequence_number": 2,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Needs Analysis",
    //           "id": "738964000000007106",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Value Proposition",
    //           "sequence_number": 3,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Value Proposition",
    //           "id": "738964000000007108",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Identify Decision Makers",
    //           "sequence_number": 4,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Id. Decision Makers",
    //           "id": "738964000000007110",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Proposal/Price Quote",
    //           "sequence_number": 5,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Proposal/Price Quote",
    //           "id": "738964000000007112",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Negotiation/Review",
    //           "sequence_number": 6,
    //           "forecast_category": {
    //             "name": "Pipeline",
    //             "id": "738964000000007092"
    //           },
    //           "actual_value": "Negotiation/Review",
    //           "id": "738964000000007114",
    //           "forecast_type": "Open"
    //         },
    //         {
    //           "display_value": "Closed Won",
    //           "sequence_number": 7,
    //           "forecast_category": {
    //             "name": "Closed",
    //             "id": "738964000000007094"
    //           },
    //           "actual_value": "Closed Won",
    //           "id": "738964000000007116",
    //           "forecast_type": "Closed Won"
    //         },
    //         {
    //           "display_value": "Closed Lost",
    //           "sequence_number": 8,
    //           "forecast_category": {
    //             "name": "Omitted",
    //             "id": "738964000000007096"
    //           },
    //           "actual_value": "Closed Lost",
    //           "id": "738964000000007118",
    //           "forecast_type": "Closed Lost"
    //         },
    //         {
    //           "display_value": "Closed-Lost to Competition",
    //           "sequence_number": 9,
    //           "forecast_category": {
    //             "name": "Omitted",
    //             "id": "738964000000007096"
    //           },
    //           "actual_value": "Closed Lost to Competition",
    //           "id": "738964000000007120",
    //           "forecast_type": "Closed Lost"
    //         }
    //       ],
    //       "actual_value": "sample",
    //       "id": "738964000001920866"
    //     }
    //   ]
    // }

    // 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 = CkJsonObjectW_SizeOfArray(jResp,L"pipeline");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        display_value = CkJsonObjectW_stringOf(jResp,L"pipeline[i].display_value");
        default = CkJsonObjectW_BoolOf(jResp,L"pipeline[i].default");
        actual_value = CkJsonObjectW_stringOf(jResp,L"pipeline[i].actual_value");
        id = CkJsonObjectW_stringOf(jResp,L"pipeline[i].id");
        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"pipeline[i].maps");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            display_value = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].display_value");
            sequence_number = CkJsonObjectW_IntOf(jResp,L"pipeline[i].maps[j].sequence_number");
            Name = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].forecast_category.name");
            Id = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].forecast_category.id");
            actual_value = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].actual_value");
            id = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].id");
            forecast_type = CkJsonObjectW_stringOf(jResp,L"pipeline[i].maps[j].forecast_type");
            j = j + 1;
        }

        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -G -d "layout_id=%7B%7Blayout_id%7D%7D"
	-H "Authorization: Bearer <access_token>"
https://domain.com/crm/v2.1/settings/pipeline

Postman Collection Item JSON

{
  "name": "Pipeline",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{api-domain}}/crm/v2.1/settings/pipeline?layout_id={{layout_id}}",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2.1",
        "settings",
        "pipeline"
      ],
      "query": [
        {
          "key": "layout_id",
          "value": "{{layout_id}}"
        }
      ]
    }
  },
  "response": [
    {
      "name": "P1: id",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/settings/pipeline?layout_id=738964000000095023",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "settings",
            "pipeline"
          ],
          "query": [
            {
              "key": "layout_id",
              "value": "738964000000095023"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 09:48:38 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    \"pipeline\": [\n        {\n            \"display_value\": \"Standard (Standard)\",\n            \"default\": false,\n            \"maps\": [\n                {\n                    \"display_value\": \"Qualification\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Qualification\",\n                    \"id\": \"738964000000007104\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Needs Analysis\",\n                    \"sequence_number\": 2,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Needs Analysis\",\n                    \"id\": \"738964000000007106\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Value Proposition\",\n                    \"sequence_number\": 3,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Value Proposition\",\n                    \"id\": \"738964000000007108\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Identify Decision Makers\",\n                    \"sequence_number\": 4,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Id. Decision Makers\",\n                    \"id\": \"738964000000007110\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Proposal/Price Quote\",\n                    \"sequence_number\": 5,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Proposal/Price Quote\",\n                    \"id\": \"738964000000007112\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Negotiation/Review\",\n                    \"sequence_number\": 6,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Negotiation/Review\",\n                    \"id\": \"738964000000007114\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Closed Won\",\n                    \"sequence_number\": 7,\n                    \"forecast_category\": {\n                        \"name\": \"Closed\",\n                        \"id\": \"738964000000007094\"\n                    },\n                    \"actual_value\": \"Closed Won\",\n                    \"id\": \"738964000000007116\",\n                    \"forecast_type\": \"Closed Won\"\n                },\n                {\n                    \"display_value\": \"Closed Lost\",\n                    \"sequence_number\": 8,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"738964000000007096\"\n                    },\n                    \"actual_value\": \"Closed Lost\",\n                    \"id\": \"738964000000007118\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Closed-Lost to Competition\",\n                    \"sequence_number\": 9,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"738964000000007096\"\n                    },\n                    \"actual_value\": \"Closed Lost to Competition\",\n                    \"id\": \"738964000000007120\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Start\",\n                    \"sequence_number\": 10,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Start\",\n                    \"id\": \"738964000002131043\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Discount Approved\",\n                    \"sequence_number\": 11,\n                    \"forecast_category\": {\n                        \"name\": \"Closed\",\n                        \"id\": \"738964000000007094\"\n                    },\n                    \"actual_value\": \"Discount Approved\",\n                    \"id\": \"738964000002131049\",\n                    \"forecast_type\": \"Closed Won\"\n                },\n                {\n                    \"display_value\": \"Discount Rejected\",\n                    \"sequence_number\": 12,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"738964000000007096\"\n                    },\n                    \"actual_value\": \"Discount Rejected\",\n                    \"id\": \"738964000002131055\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Contract Sent\",\n                    \"sequence_number\": 13,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Contract Sent\",\n                    \"id\": \"738964000002131061\",\n                    \"forecast_type\": \"Open\"\n                }\n            ],\n            \"actual_value\": \"Standard (Standard)\",\n            \"id\": \"738964000001920858\"\n        },\n        {\n            \"display_value\": \"sample\",\n            \"default\": true,\n            \"maps\": [\n                {\n                    \"display_value\": \"Qualification\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Qualification\",\n                    \"id\": \"738964000000007104\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Needs Analysis\",\n                    \"sequence_number\": 2,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Needs Analysis\",\n                    \"id\": \"738964000000007106\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Value Proposition\",\n                    \"sequence_number\": 3,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Value Proposition\",\n                    \"id\": \"738964000000007108\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Identify Decision Makers\",\n                    \"sequence_number\": 4,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Id. Decision Makers\",\n                    \"id\": \"738964000000007110\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Proposal/Price Quote\",\n                    \"sequence_number\": 5,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Proposal/Price Quote\",\n                    \"id\": \"738964000000007112\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Negotiation/Review\",\n                    \"sequence_number\": 6,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"738964000000007092\"\n                    },\n                    \"actual_value\": \"Negotiation/Review\",\n                    \"id\": \"738964000000007114\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Closed Won\",\n                    \"sequence_number\": 7,\n                    \"forecast_category\": {\n                        \"name\": \"Closed\",\n                        \"id\": \"738964000000007094\"\n                    },\n                    \"actual_value\": \"Closed Won\",\n                    \"id\": \"738964000000007116\",\n                    \"forecast_type\": \"Closed Won\"\n                },\n                {\n                    \"display_value\": \"Closed Lost\",\n                    \"sequence_number\": 8,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"738964000000007096\"\n                    },\n                    \"actual_value\": \"Closed Lost\",\n                    \"id\": \"738964000000007118\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Closed-Lost to Competition\",\n                    \"sequence_number\": 9,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"738964000000007096\"\n                    },\n                    \"actual_value\": \"Closed Lost to Competition\",\n                    \"id\": \"738964000000007120\",\n                    \"forecast_type\": \"Closed Lost\"\n                }\n            ],\n            \"actual_value\": \"sample\",\n            \"id\": \"738964000001920866\"\n        }\n    ]\n}"
    },
    {
      "name": "SUCCESS RESPONSE",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/settings/pipeline?layout_id=4150868000000091023",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "settings",
            "pipeline"
          ],
          "query": [
            {
              "key": "layout_id",
              "value": "4150868000000091023"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 10:56:06 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-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-10T17:05:19+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4016246"
        },
        {
          "key": "clientsubVersion",
          "value": "59f8474ad0046d6a2f6204e0448818d0"
        },
        {
          "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=63072000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"pipeline\": [\n        {\n            \"display_value\": \"Standard (Standard)\",\n            \"default\": true,\n            \"maps\": [\n                {\n                    \"display_value\": \"Qualification\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Qualification\",\n                    \"id\": \"4150868000000006801\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Needs Analysis\",\n                    \"sequence_number\": 2,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Needs Analysis\",\n                    \"id\": \"4150868000000006803\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Value Proposition\",\n                    \"sequence_number\": 3,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Value Proposition\",\n                    \"id\": \"4150868000000006805\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Identify Decision Makers\",\n                    \"sequence_number\": 4,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Id. Decision Makers\",\n                    \"id\": \"4150868000000006807\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Proposal/Price Quote\",\n                    \"sequence_number\": 5,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Proposal/Price Quote\",\n                    \"id\": \"4150868000000006811\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Negotiation/Review\",\n                    \"sequence_number\": 6,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Negotiation/Review\",\n                    \"id\": \"4150868000000006813\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Closed Won\",\n                    \"sequence_number\": 7,\n                    \"forecast_category\": {\n                        \"name\": \"Closed\",\n                        \"id\": \"4150868000000006789\"\n                    },\n                    \"actual_value\": \"Closed Won\",\n                    \"id\": \"4150868000000006815\",\n                    \"forecast_type\": \"Closed Won\"\n                },\n                {\n                    \"display_value\": \"Closed Lost\",\n                    \"sequence_number\": 8,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"4150868000000006791\"\n                    },\n                    \"actual_value\": \"Closed Lost\",\n                    \"id\": \"4150868000000006817\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Closed-Lost to Competition\",\n                    \"sequence_number\": 9,\n                    \"forecast_category\": {\n                        \"name\": \"Omitted\",\n                        \"id\": \"4150868000000006791\"\n                    },\n                    \"actual_value\": \"Closed Lost to Competition\",\n                    \"id\": \"4150868000000006819\",\n                    \"forecast_type\": \"Closed Lost\"\n                },\n                {\n                    \"display_value\": \"Discount Approved\",\n                    \"sequence_number\": 10,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Discount Approved\",\n                    \"id\": \"4150868000000732001\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Discount Rejected\",\n                    \"sequence_number\": 11,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Discount Rejected\",\n                    \"id\": \"4150868000000732004\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Contract sent\",\n                    \"sequence_number\": 12,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Contract sent\",\n                    \"id\": \"4150868000000732007\",\n                    \"forecast_type\": \"Closed Won\"\n                },\n                {\n                    \"display_value\": \"Start\",\n                    \"sequence_number\": 13,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Start\",\n                    \"id\": \"4150868000000732010\",\n                    \"forecast_type\": \"Closed Won\"\n                }\n            ],\n            \"actual_value\": \"Standard (Standard)\",\n            \"id\": \"4150868000001874009\"\n        },\n        {\n            \"display_value\": \"Option 1\",\n            \"default\": false,\n            \"maps\": [\n                {\n                    \"display_value\": \"Qualification\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Qualification\",\n                    \"id\": \"4150868000000006801\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Proposal/Price Quote\",\n                    \"sequence_number\": 2,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Proposal/Price Quote\",\n                    \"id\": \"4150868000000006811\",\n                    \"forecast_type\": \"Open\"\n                }\n            ],\n            \"actual_value\": \"Option 1\",\n            \"id\": \"4150868000001874016\"\n        },\n        {\n            \"display_value\": \"Option 2\",\n            \"default\": false,\n            \"maps\": [\n                {\n                    \"display_value\": \"Negotiation/Review\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Negotiation/Review\",\n                    \"id\": \"4150868000000006813\",\n                    \"forecast_type\": \"Open\"\n                }\n            ],\n            \"actual_value\": \"Option 2\",\n            \"id\": \"4150868000001874021\"\n        },\n        {\n            \"display_value\": \"436\",\n            \"default\": false,\n            \"maps\": [\n                {\n                    \"display_value\": \"Qualification\",\n                    \"sequence_number\": 1,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Qualification\",\n                    \"id\": \"4150868000000006801\",\n                    \"forecast_type\": \"Open\"\n                },\n                {\n                    \"display_value\": \"Needs Analysis\",\n                    \"sequence_number\": 2,\n                    \"forecast_category\": {\n                        \"name\": \"Pipeline\",\n                        \"id\": \"4150868000000006787\"\n                    },\n                    \"actual_value\": \"Needs Analysis\",\n                    \"id\": \"4150868000000006803\",\n                    \"forecast_type\": \"Open\"\n                }\n            ],\n            \"actual_value\": \"436\",\n            \"id\": \"4150868000004595013\"\n        }\n    ]\n}"
    },
    {
      "name": "REQUIRED_PARAM_MISSING",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/settings/pipeline",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "settings",
            "pipeline"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 10:56:46 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "141"
        },
        {
          "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-ACCESSTOKEN-RESET",
          "value": "2021-05-10T17:05:19+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4016246"
        },
        {
          "key": "clientsubVersion",
          "value": "59f8474ad0046d6a2f6204e0448818d0"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"REQUIRED_PARAM_MISSING\",\n    \"details\": {\n        \"param_name\": \"layout_id\"\n    },\n    \"message\": \"One of the expected parameter is missing\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "INVALID_DATA",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/settings/pipeline?layout_id=415086800000009102",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "settings",
            "pipeline"
          ],
          "query": [
            {
              "key": "layout_id",
              "value": "415086800000009102"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 10:57:20 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "107"
        },
        {
          "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-ACCESSTOKEN-RESET",
          "value": "2021-05-10T17:05:19+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4016246"
        },
        {
          "key": "clientsubVersion",
          "value": "59f8474ad0046d6a2f6204e0448818d0"
        },
        {
          "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_DATA\",\n    \"details\": {\n        \"param_name\": \"layout_id\"\n    },\n    \"message\": \"Invalid layoutid\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "OAUTH_SCOPE_MISMATCH",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/settings/pipeline?layout_id=4150868000000091023",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "settings",
            "pipeline"
          ],
          "query": [
            {
              "key": "layout_id",
              "value": "4150868000000091023"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 08:41:46 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}"
    }
  ]
}