Using the retrieve guest data extension expanded function in Sitecore CDP REST API

Abstract

Provides details on retrieving a full expanded guest record with custom attributes in Sitecore CDP (Data model 2.0).

You can use the Guest REST API to perform the retrieve guest data extension expanded function to return an expanded full guest record using identifying information stored in a data extension. To do this, you need the guestRef returned when you locate a guest data extension.

To retrieve an expanded, full guest record using information from a data extension in the Sitecore CDP, use the following:

GET: https://apiEndpoint/v2/guests/guestRef?expand=dataExtensionName

Attribute

Description

Type

guestRef

The unique ID of the guest generated by Sitecore CDP.

string

dataExtensionName

The name of the data extension to expand.

string

$ curl -H "Accept: application/json" \
    "https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46?expand=extExt"

The following is a 200 response:

{
   "href":"https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46",
   "ref":"9d94ee11-7043-4b71-980c-a777d00a7b46",
   "createdAt":"2010-03-07T16:15:11.000Z",
   "modifiedAt":"2012-08-23T16:17:16.000Z",
   "firstSeen":"2010-03-07T16:15:11.000Z",
   "lastSeen":"2012-08-23T16:17:16.000Z",
   "guestType":"customer",
   "extExt":{
      "href":"http://{apiEndpoint}/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extExt",
      "offset":0,
      "limit":10,
      "items":[
         {
            "href":"http://{apiEndpoint}/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extExt/0349654D-5DB7-4103-8C9E-88953648EE18",
            "ref":"0349654D-5DB7-4103-8C9E-88953648EE18",
            "createdAt":"2010-03-07T16:15:11.000Z",
            "modifiedAt":"2012-08-23T16:17:16.000Z",
            "key":"default",
            "format":"HTML",
            "acceptedTermsAndConditions":true,
            "shortDescription":"The email preferences for this guest",
            "longDescription":"The email preferences for this guest"
         },
         {
            "href":"http://{apiEndpoint}/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extExt/0349654D-5DB7-4103-8C9E-88953648EE19",
            "ref":"0349654D-5DB7-4103-8C9E-88953648EE19",
            "createdAt":"2010-03-07T16:15:11.000Z",
            "modifiedAt":"2012-08-23T16:17:16.000Z",
            "key":"default",
            "format":"PLAIN/TEXT",
            "acceptedTermsAndConditions":true,
            "shortDescription":"The SMS preferences for this guest",
            "longDescription":"The SMS preferences for this guest"
         }
      ]
   }
}