A guest data extension is an object that lets you specify any key-value pairs you want. Guest data extensions are optional and enable your organization to capture more robust information about your guests.

To get started with this API, create a data extension for the guest you previously created, then find the data in Sitecore CDP in the guest profile.

Request

Creates a data extension for a guest. You can create up to six data extensions.

To avoid creating key-value pairs in a data extension that already exist within a guest profile, first retrieve a guest's collection of data extensions to check that the keys you intend to create are unique.

Creating the request body

In the request body, you must provide one object. This object represents the data extension. Note the following about the object:

  • Can contain primitive values only. You cannot nest objects. If you need to group key-value pairs, use prefixes for the key names.
  • Can contain a maximum of 100 key-value pairs.
  • Must contain the name key. This is the name of the data extension.
    • If you send extension data from one source, set the value for name to ext.
    • If you send extension data from multiple sources, you can create up to six data extensions by setting the value for name to one of the following: ext, ext1, ext2, ext3, ext4, ext5.
  • The other key-value pairs you include in the object become the extension data. For example, if you include "loyaltyTier": "level2" in the object, Loyalty Tier with the value of level2 becomes extension data.
  • Supported data types for the values:
    • string, for example "level2"
    • boolean, for example true
    • integer, for example 9
    • floating-point number, for example 99.9

Naming keys

The keys you enter in the request body must be:

  • Alphanumeric [A-Z,a-z,0-9] as per the JSON RFC 7159 specification.
  • In camel case.
  • Unique across all data extensions within a guest profile. For example, if ext contains the vipMember key, you must not use that key in any other data extensions for the same guest.

Example request body

Here's an example request body:

{
"name": "ext",
"vipMember": true,
"loyaltyTier": "level2",
"rewardBalance": 5012.25,
"loyaltyNumber": 3452
}

This creates four key-value pairs in the ext data extension for the guest.

Finding the data in Sitecore CDP

You can find the created data in Sitecore CDP by clicking Guests > the guest profile you created the data for > Properties > Additional information:

  • The ext data displays in Data extension group.
  • The ext1 data displays in Data extension group 1.
  • The ext2 data displays in Data extension group 2.
  • The ext3 data displays in Data extension group 3.
  • The ext4 data displays in Data extension group 4.
  • The ext5 data displays in Data extension group 5.

Multiple sources

You can send extension data from multiple sources. For example, your organization might want to send extension data both from a loyalty system to capture loyalty data, and from a Customer Relationship Management (CRM) system to capture email preferences, alternative mailing addresses, and so on.

To send data from multiple sources, we recommend that you use a different data extension name for each source system. For example, use the ext data extension for the loyalty system data, and use the ext1 data extension for the CRM data.

Security
BasicAuth
Path
guestRefstringrequired

The guest reference. This is a unique identifier of the guest record. If you don't know the guest reference, first retrieve guests.

Example:f7aabbca-1c1b-4fc2-be72-3e16294a4f03
Bodyapplication/json
namestringrequired

The name of the data extension.

Enum:"ext""ext1""ext2""ext3""ext4""ext5"
Example:"ext1"
{exampleKey1}string or boolean or integer or number

A key-value pair of your choice. Example: "vipMember": true

Example:"{exampleValue1}"
{exampleKey2}string or boolean or integer or number

A key-value pair of your choice. Example: "loyaltyTier": "level2"

Example:"{exampleValue2}"
curl -i -X POST \
  -u '<username>:<password>' \
  https://api-engage-ap.sitecorecloud.io/v2.1/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/extensions \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "ext1",
    "{exampleKey1}": "{exampleValue1}",
    "{exampleKey2}": "{exampleValue2}"
  }'

Responses

Successful operation

Bodyapplication/json
createdAtstring, (date-time)

The date and time when the resource was created in Sitecore CDP.

Example:"2024-01-01T16:17:16.000Z"
guestobject(GuestHref)
hrefstring

The URL of the guest extension.

Example:"https://api-engage-eu.sitecorecloud.io/v2.1/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/ext1"
keystring

You must set this to default.

Example:"default"
modifiedAtstring, (date-time)

The date and time when the resource was last updated in Sitecore CDP.

Example:"2024-01-01T16:17:16.000Z"
namestring

The name of the data extension. You can only use a name once in a collection.

Example:"ext"
refstring

Guest extension reference.

Example:"6a5cb3c2-1a4a-56d8-8a01-1ede232b9db2"
{exampleKey1}string or boolean or integer or number

A key-value pair in the data extension. Example: "vipMember": true

Example:"{exampleValue1}"
{exampleKey2}string or boolean or integer or number

A key-value pair in the data extension. Example: "loyaltyTier": "level2"

Example:"{exampleValue2}"
Response
{ "createdAt": "2024-01-01T16:17:16.000Z", "guest": { "href": "https://api-engage-eu.sitecorecloud.io/v2.1/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03" }, "href": "https://api-engage-eu.sitecorecloud.io/v2.1/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03/ext1", "key": "default", "modifiedAt": "2024-01-01T16:17:16.000Z", "name": "ext", "ref": "6a5cb3c2-1a4a-56d8-8a01-1ede232b9db2", "{exampleKey1}": "{exampleValue1}", "{exampleKey2}": "{exampleValue2}" }