Chilkat Online Tools

SQL Server / Zoho CRM REST APIs / Pipeline

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @queryParams int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'layout_id', '{{layout_id}}'

    -- Adds the "Authorization: Bearer <access_token>" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://domain.com/crm/v2.1/settings/pipeline', @queryParams
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        RETURN
      END

    DECLARE @sbResponseBody int
    -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @resp

        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @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

    DECLARE @display_value nvarchar(4000)

    DECLARE @default int

    DECLARE @actual_value nvarchar(4000)

    DECLARE @id nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @sequence_number int

    DECLARE @Name nvarchar(4000)

    DECLARE @Id nvarchar(4000)

    DECLARE @forecast_type nvarchar(4000)

    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'pipeline'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @display_value OUT, 'pipeline[i].display_value'
        EXEC sp_OAMethod @jResp, 'BoolOf', @default OUT, 'pipeline[i].default'
        EXEC sp_OAMethod @jResp, 'StringOf', @actual_value OUT, 'pipeline[i].actual_value'
        EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'pipeline[i].id'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'pipeline[i].maps'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @display_value OUT, 'pipeline[i].maps[j].display_value'
            EXEC sp_OAMethod @jResp, 'IntOf', @sequence_number OUT, 'pipeline[i].maps[j].sequence_number'
            EXEC sp_OAMethod @jResp, 'StringOf', @Name OUT, 'pipeline[i].maps[j].forecast_category.name'
            EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'pipeline[i].maps[j].forecast_category.id'
            EXEC sp_OAMethod @jResp, 'StringOf', @actual_value OUT, 'pipeline[i].maps[j].actual_value'
            EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'pipeline[i].maps[j].id'
            EXEC sp_OAMethod @jResp, 'StringOf', @forecast_type OUT, 'pipeline[i].maps[j].forecast_type'
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @queryParams
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

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}"
    }
  ]
}