Skip to main content

Use the retrieve guest function in Sitecore CDP REST API

Abstract

Provides a cURL command to retrieve guests in Sitecore CDP REST API (Data model 2.0).

You can use the Guest REST API to perform a retrieve guest function to retrieve the full guest record. You can use the locate guest function if you do not know the guestRef.

After you retrieve the guest, you can update the guest, if you want to change any guest attributes.

To retrieve a guest in the Sitecore CDP, use the following: GET https://apiEndpoint/v2/guests/guestRef

Attribute

Description

Type

guestRef

The reference of the guest record.

string

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

The following is a 201 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",
    "title": "Mr",
    "firstName": "Jack",
    "lastName": "Smith",
    "gender": "male",
    "dateOfBirth": "1976-10-28T00:00:00.000Z",
    "emails": [
        "jack.smith@boxever.com"
    ],
     "phoneNumbers": [
        "0851234567"
    ],
    "nationality": "Irish",
    "passportNumber": "PZ4A9565",
    "passportExpiry": "2019-01-01T00:00:00.000Z",
    "street": [
        "Apartment 15",
        "West Drive Avenue"
    ],
    "city": "Dublin",
    "country": "IE",
    "postCode": "D2",
    "state": "Dublin",
    "subscriptions": [
        {
            "name": "default",
            "channel": "EMAIL",
            "pointOfSale": "default",
            "status": "SUBSCRIBED",
            "effectiveDate": "2012-08-23T16:17:16.000Z"
        }
    ],
    "identifiers": [
        {
            "provider": "ProfileSystem",
            "id": "B7524AE6-CF1C-440F-B1A2-0C9D42F5CB41",
            "expiryDate": "2016-08-23T16:17:16.000Z"
        }
    ]
}