Using the create guest data extension function in Sitecore CDP REST API
Abstract
Provides details on sending additional custom fields about the guest in Sitecore CDP (Data model 2.0).
You can use the Guest REST API to perform a create guest data extension
function to add additional custom fields to the guest
object.
To create a guest in the Sitecore CDP, use the following:
POST: https://apiEndpoint/v2/guests/guestRef/extdataExtensionName
Attribute | Description | Type |
---|---|---|
| The reference of the guest. | string |
| The data extension name. | string |
The key
attribute in the body of the POST request is the data extension key with a string type.
$curl --request POST 'https://{apiEndpoint}/v2/guests/9d94ee11-7043-4b71-980c-a777d00a7b46/extExt' \ --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 a 201 Created
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" }