Deliver offers using the Decisioning API decisioning-api
With Decision Management, you can create and deliver end-user personalized offer experiences, across channels and applications using business logic and decision rules. An offer is a marketing message that may have rules associated with it that specify who is eligible to see the offer.
You can create and deliver offers by making a POST request to the Decisioning API.
This tutorial requires a working understanding of APIs, specifically with regards to Decision Management. For more information, see the Decision Management API developer guide. This tutorial also requires that you have a unique placement ID and decision ID value available. If you have not acquired these values, see the tutorials for creating a placement and creating a decision.
Required headers required-headers
The following table shows the valid values which comprise the Content-Type and Accept fields in the request header:
application/vnd.adobe.xdm+json; schema="https://ns.adobe.com/experience/offer-management/decision-response;version=1.0"application/vnd.adobe.xdm+json; schema="https://ns.adobe.com/experience/offer-management/decision-request;version=1.0"Bearer {ACCESS_TOKEN}{IMS_ORG}{SANDBOX_NAME}{API_KEY}- All requests that contain a payload (POST,PUT,PATCH) require the content-type header
API request request
API format
POST /{ENDPOINT_PATH}/decisions
{ENDPOINT_PATH}https://platform.adobe.io/data/core/odsRequest
curl -X POST 'https://platform.adobe.io/data/core/ods/decisions' \
-H 'Accept: application/vnd.adobe.xdm+json; schema="https://ns.adobe.com/experience/offer-management/decision-response;version=1.0"' \
-H 'Content-Type: application/vnd.adobe.xdm+json; schema="https://ns.adobe.com/experience/offer-management/decision-request;version=1.0"' \
-H 'Authorization: Bearer {ACCESS_TOKEN}....' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'x-sandbox-id: {SANDBOX_ID}' \
-H 'x-request-id: e9ac8d7e-3e77-4b38-8726-555ef1737b32-example' \
-d '{
"xdm:propositionRequests": [
{
"xdm:activityId": "dps:offer-activity:15ded04b1786ea27",
"xdm:placementId": "dps:offer-placement:15d9bc01d35e1238"
}
],
"xdm:profiles": [
{
"xdm:identityMap": {
"Email": [
{
"xdm:id": "example@adobe.com",
"primary": true
}
]
}
}
],
"xdm:allowDuplicatePropositions": {
"xdm:acrossActivities": true,
"xdm:acrossPlacements": true
},
"xdm:responseFormat": {
"xdm:includeContent": true,
"xdm:includeMetadata": {
"xdm:activity": [
"name"
],
"xdm:option": [
"name"
],
"xdm:placement": [
"name"
]
}
}
}'
xdm:propositionRequestsxdm:propositionRequests.xdm:placementId"xdm:placementId": "dps:offer-placement:ffed0456"xdm:propositionRequests.xdm:activityId"xdm:activityId": "dps:offer-activity:ffed0123"xdm:itemCount"xdm:itemCount": 2xdm:profilesxdm:profiles.xdm:identityMapEmail: [{"xdm:id": "123@abc.com"}]xdm:profiles.xdm:decisionRequestId"xdm:decisionRequestId": "0AA00002-0000-1224-c0de-cjf98Csj43"xdm:allowDuplicatePropositionsxdm:allowDuplicatePropositions.xdm:acrossActivities"xdm:acrossActivities": truexdm:allowDuplicatePropositions.xdm:acrossPlacements"xdm:acrossPlacements": truexdm:enrichedAudience"xdm:enrichedAudience": truexdm:mergePolicy.xdm:id"xdm:id": "5f3ed32f-eaf1-456c-b0f0-7b338c4cb18a"xdm:responseFormatxdm:responseFormat.xdm:includeContenttrue, includes content to the response."xdm:includeContent": truexdm:responseFormat.xdm:includeMetadataxdm:id and repo:etag are returned by default.namexdm:responseFormat.xdm:activityxdm:activity.namexdm:responseFormat.xdm:optionxdm:option.name, characteristicsxdm:responseFormat.xdm:placementxdm:placement.name, channel, componentTypeResponse
A successful response returns information on your proposition, including its unique xdm:propositionId.
{
"xdm:propositionId": "5d0ffb5e-dfc6-4280-99b6-0bf3131cb8b8",
"xdm:propositions": [
{
"xdm:activity": {
"xdm:id": "dps:activity:ffed0123",
"repo:etag": 4
},
"xdm:placement": {
"xdm:id": "dps:placement:ffed0456",
"repo:etag": 1
},
"xdm:options": [
{
"xdm:id": "dps:personalized-option:ccc0111",
"repo:etag": 3,
"@type": "https://ns.adobe.com/experience/decisioning/content-component-html-template",
"xdm:content": "<html>some html</html>"
},
{
"xdm:id": "dps:personalized-option:ccc0222",
"repo:etag": 5,
"@type": "https://ns.adobe.com/experience/decisioning/content-component-html-template",
"xdm:content": "<html>hello, world</html>",
"xdm:score": 45.65
}
]
},
{
"xdm:activity": {
"xdm:id": "dps:activity:ffed0123",
"repo:etag": 4
},
"xdm:placement": {
"xdm:id": "dps:placement:ffed0789",
"repo:etag": 2
},
"xdm:fallback": {
"xdm:id": "dps:fallback:ccc0222",
"repo:etag": 5,
"@type": "https://ns.adobe.com/experience/decisioning/content-component-imagelink",
"dc:format": "image/png",
"xdm:deliveryURL": "https://cdn.adobe.com/content/1445323-1134331.png",
"xdm:content": "https://www.adobe.com/index2.html"
}
}
],
"ode:createDate": 1566497582038
}
xdm:propositionId"xdm:propositionId": "5d0ffb5e-dfc6-4280-99b6-0bf3131cb8b8"xdm:propositionsoptions property or a fallback property. When present, the options property cannot be empty.xdm:propositions.xdm:activity"xdm:id": "dps:activity:ffed0123"xdm:propositions.xdm:placement"xdm:id": "dps:placement:ffed0456"xdm:propositions.xdm:optionsxdm:id": "dps:personalized-option:ccc0111xdm:propositions.xdm:options.@type@type acts as the processing contract for the client. When the experience is assembled, the composer will look for the component(s) that have a specific type.https://ns.adobe.com/experience/offer-management/content-component-imagelinkxdm:propositions.xdm:contenttext, html block, or image linkxdm:score"xdm:score": 45.65xdm:propositions.xdm:fallback"xdm:id": "dps:fallback:ccc0222"xdm:propositions.xdm:fallback.dc:format"dc:format": "image/png" or "image/jpeg"xdm:propositions.xdm:fallback.xdm:deliveryURLhttps://d37yhxrr0p3l3l.cloudfront.net/0fd0f090-a148-11ea-89e3-f1f2ad52f7e8/urn:aaid:sc:US:a68c86a6-9295-4940-a083-11916b665500/0/40d78a12-f8b6-3f07-8e67-7cb8ae2cc7ecode:createDate"ode:createDate": 1566497582038Response codes
The table below lists all codes that can be returned in the response:
Next steps next-steps
By following this API guide, you have created and delivered offers using the Decisions API. For more information, see the overview on Decision Management.