Using the update guest data extension function in Sitecore CDP REST API

Abstract

Provides details on updating additional custom fields about the guest in Sitecore CDP (Data model 2.0).

You can use the Guest REST API to perform the update guest data extension function to update the custom attributes of a guest stored in the guest data extension. To do this, you need the guestRef returned when you locate a guest data extension.

To update a guest data extension in the Sitecore CDP, use the following:

POST: https://apiEndpoint/v2/guests/guestRef/extdataExtensionName/dataExtensionRef

Attribute

Description

Type

guestRef

The unique ID of the guest generated by Sitecore CDP.

string

dataExtensionName

The data extension name.

string

dataExtensionRef

The reference of the data extension.

string

$curl  --request POST 'https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extExt/0349654D-5DB7-4103-8C9E-88953648EE18' \
 --header 'Content-Type: application/json' \
 --data-raw '{
    "key": "email",
    "format": "HTML",
    "acceptedTermsAndConditions": true,
    "shortDescription": "The email preferences for this guest",
    "longDescription": "The email preferences for this guest"
}'

The following is the 200 response:

{
    "href": "https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extPreferences/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": "email",
    "format": "HTML",
    "acceptedTermsAndConditions": true,
    "shortDescription": "The email preferences for this guest",
    "longDescription": "The email preferences for this guest"
}