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.
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
namekey. This is the name of the data extension.- If you send extension data from one source, set the value for
nametoext. - If you send extension data from multiple sources, you can create up to six data extensions by setting the value for
nameto one of the following:ext,ext1,ext2,ext3,ext4,ext5.
- If you send extension data from one source, set the value for
- 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 oflevel2becomes 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
- string, for example
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
extcontains thevipMemberkey, you must not use that key in any other data extensions for the same guest.
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.
You can find the created data in Sitecore CDP by clicking Guests > the guest profile you created the data for > Properties > Additional information:
- The
extdata displays in Data extension group. - The
ext1data displays in Data extension group 1. - The
ext2data displays in Data extension group 2. - The
ext3data displays in Data extension group 3. - The
ext4data displays in Data extension group 4. - The
ext5data displays in Data extension group 5.
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.
The name of the data extension.
A key-value pair of your choice. Example: "vipMember": true
- Production server APhttps://api-engage-ap.sitecorecloud.io/v2.1/guests/{guestRef}/extensions
- Production server EUhttps://api-engage-eu.sitecorecloud.io/v2.1/guests/{guestRef}/extensions
- Production server JPhttps://api-engage-jpe.sitecorecloud.io/v2.1/guests/{guestRef}/extensions
- Production server UShttps://api-engage-us.sitecorecloud.io/v2.1/guests/{guestRef}/extensions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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}"
}'Successful operation
The date and time when the resource was created in Sitecore CDP.
The URL of the guest extension.
The date and time when the resource was last updated in Sitecore CDP.
The name of the data extension. You can only use a name once in a collection.
A key-value pair in the data extension. Example: "vipMember": true
{ "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}" }