Use the retrieve connections function in Sitecore CDP REST API

Abstract

How to retrieve a list of available connections for Sitecore CDP (Data model 2.1).

You can use the Connections REST API to perform the retrieve connections function to return a list of available connections for Sitecore CDP.

To retrieve a list of external connections in Sitecore CDP, use the following:

GET: https://apiEndpoint/v2/connections

$ curl -H "Accept: application/json" \
    "https://{apiEndpoint}/v2/connections"

The following is a 200 response:

{  
   "href":"https://{apiEndpoint}/v2/connections",
   "items":[  
      {  
         "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
         "href":"https://dev-api.boxever.com/v2/connections/1a82b284-4415-4205-94d6-b716e2aea6a8",
         "ref":"1a82b284-4415-4205-94d6-b716e2aea6a8",
         "name":"#Connect to Data System",
         "description":"custom connection to data system",
         "modifiedByUserRef":"c008c81d-4941-46aa-b4e6-a17e8388498a",
         "modifiedAt":"2018-10-03T13:59:09.258Z",
         "revision":1,
         "archived":false,
         "auth":{  
            "authType":"oauth",
            "clientId":"secretclientid",
            "accessTokenUrl":"https://mockserver-proxy-dev.boxever.com/oauth/token"
         },
         "request":{  
            "requestType":"get",
            "connectionUrl":"https://mockserver-proxy-dev.boxever.com/sample/get/oauth"
         },
          "inputMappings":[  
            {  
               "label":"City",
               "key":"city",
               "type":"String",
               "exampleValue":"DUB",
               "mapping":""
            }
         ],
         "outputMappings":[  
            {  
               "label":"Weather At Location",
               "outputReference":"weatherAtLocation",
               "type":"String"
            }
         ],
         "customHeaders":[  
            {  
               "externalConnectionRef":"1a82b284-4415-4205-94d6-b716e2aea6a8",
               "name":"Accept",
               "value":"application/json"
            },
            {  
               "externalConnectionRef":"1a82b284-4415-4205-94d6-b716e2aea6a8",
               "name":"Accept-Encoding",
               "value":"gzip"
            }
         ],
         "systemType":"DATA_SYSTEM",
         "connectionTimeout":0,
         "socketTimeout":0,
         "icon":"string"
      }
   ]
}