Skip to main content

Use the retrieve a connection function in Sitecore CDP REST API

Abstract

How to retrieve a connection in Sitecore CDP (Data model 2.1).

You can use the Connections REST API to perform the retrieve a connection function to return a unique decision model reference. To do this, you must have the ref attribute returned when retrieving the connections.

To retrieve a connection in Sitecore CDP, use the following:

GET: https://apiEndpoint/v2/connections/<ref>

Attribute

Description

Type

ref

The reference of the connection.

string

$ curl -H "Accept: application/json" \
    "https://{apiEndpoint}/v2/connections/865ce079-6012-4f97-bc46-07215691a178"

The following is a 200 response:

{
  "type": "string",
  "clientKey": "string",
  "href": "string",
  "ref": "string",
  "name": "Weather Data System",
  "description": "openweathermap.org connection",
  "modifiedByUserRef": "c008c81d-4941-46aa-b4e6-a17e8388498a",
  "modifiedAt": "2018-10-05T12:14:20.136Z",
  "revision": 0,
  "revisionComment": "first connection config",
  "archived": false,
  "auth": {
    "authType": "oauth"
  },
  "request": {
    "requestType": "get",
    "connectionUrl": "https://mockserver-proxy-dev.boxever.com/sample/get/basicauth"
  },
  "exampleValue": "string",
   "inputMappings":[  
            {  
               "label":"City",
               "key":"city",
               "type":"String",
               "exampleValue":"DUB",
               "mapping":""
            }
         ],
         "outputMappings":[  
            {  
               "label":"Weather At Location",
               "outputReference":"weatherAtLocation",
               "type":"String"
            }
         ],
  "customHeaders": [
    {
      "externalConnectionRef": "8ad39f25-d75b-44b5-bcd0-b8f92ead9ba5",
      "name": "Accept",
      "value": "application/json"
    }
  ],
  "systemType": "DATA_SYSTEM",
  "connectionTimeout": 1000,
  "socketTimeout": 1000,
  "icon": "assets/images/icons/connections/predict-hq.png"
}