Bereitstellen von Angeboten mithilfe der Decisioning-API decisioning-api
Mit dem Entscheidungs-Management können Sie personalisierte Angebotserlebnisse für Endbenutzer erstellen und bereitstellen, und zwar über Kanäle und Anwendungen hinweg und unter Verwendung von Business-Logik und Entscheidungsregeln. Ein Angebot ist eine Marketing-Botschaft, der ggf. Regeln zugeordnet sind, die angeben, wer für die Anzeige des Angebots infrage kommt.
Sie können Angebote erstellen und bereitstellen, indem Sie eine POST-Anfrage an die Decisioning-API senden.
Dieses Tutorial erfordert ein Verständnis von APIs, insbesondere im Hinblick auf das Entscheidungs-Management. Weitere Informationen finden Sie im Entwicklerhandbuch zur Entscheidungs-Management-API. Für dieses Tutorial benötigen Sie außerdem Werte für eine eindeutige Platzierungs- und Entscheidungskennung. Wenn Sie diese Werte nicht erhalten haben, finden Sie in den Tutorials zum Erstellen einer Platzierung und zum Erstellen einer Entscheidung weitere Informationen.
Erforderliche Kopfzeilen required-headers
Die folgende Tabelle zeigt die gültigen Werte, die die Felder Content-Type und Accept im Anfrage-Header enthalten:
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}- Alle Anfragen, die eine Payload enthalten (POST,PUT,PATCH), benötigen eine Inhaltstyp-Kopfzeile.
API-Anfrage request
API-Format
POST /{ENDPOINT_PATH}/decisions
{ENDPOINT_PATH}https://platform.adobe.io/data/core/odsAnfrage
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 gesetzt wird."xdm:includeContent": truexdm:responseFormat.xdm:includeMetadataxdm:id und repo:etag zurückgegeben.namexdm:responseFormat.xdm:activityxdm:activity zurückgegeben werden.namexdm:responseFormat.xdm:optionxdm:option zurückgegeben werden.name, characteristicsxdm:responseFormat.xdm:placementxdm:placement zurückgegeben werden.name, channel, componentTypeAntwort
Eine erfolgreiche Antwort gibt Informationen zu Ihrem Vorschlag zurück, einschließlich der eindeutigen 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-Eigenschaft oder eine fallback-Eigenschaft. Wenn vorhanden, darf die options-Eigenschaft nicht leer sein.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 fungiert als Verarbeitungsvertrag für den Client. Wenn das Erlebnis zusammengestellt wird, sucht der Composer nach den Komponenten eines bestimmten Typs.https://ns.adobe.com/experience/offer-management/content-component-imagelinkxdm:propositions.xdm:contenttext, html block oder image link.xdm:score"xdm:score": 45.65xdm:propositions.xdm:fallback"xdm:id": "dps:fallback:ccc0222"xdm:propositions.xdm:fallback.dc:format"dc:format": "image/png" oder "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": 1566497582038Antwort-Codes
In der folgenden Tabelle sind alle Codes aufgeführt, die in der Antwort zurückgegeben werden können:
Nächste Schritte next-steps
Durch Befolgen dieses API-Handbuchs haben Sie Angebote mithilfe der Decisions-API erstellt und bereitgestellt. Weitere Informationen finden Sie unter Übersicht über das Entscheidungs-Management.