Expand my Community achievements bar.

SOLVED

Delivery API - which payload is up to date ?

Avatar

Level 7

I would like to implement recommendations in email. 

There are two different payloads presented in documentation. I am not sure which one to use. 

1. Delivery API docs: https://developer.adobe.com/target/implement/delivery-api/

Michael_Soprano_0-1719925787936.png

2. Email personalization docs: https://experienceleague.adobe.com/en/docs/target/using/recommendations/recommendations-faq/integrat...

Michael_Soprano_1-1719925822649.png

The response for the second one I got is:

Michael_Soprano_2-1719925914497.png

Client code is 100% valid. In another requests it works. 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Here's a sample Delivery API that could work: 

 

curl -X POST \
  'https://clientcode.tt.omtrdc.net/rest/v1/delivery?client=clientcode&sessionId=9979fc32c26d49df8e04a6d734' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
  "context": {
    "channel": "web"
  },
  "id": {
    "tntId": "4920148a9a9f4061a3aff5cfe5be1cb3.35_0",
    "marketingCloudVisitorId": "54485242253040699773642612187575264854"
  },
  "property": {
    "token": "b468a242-64a4-32a0-ca0c-890bddd78789"
  },
  "execute": {
    "mboxes": [
      {
        "parameters": {
          "entity.id": "article-123",
          "entity.event.detailsOnly" : "true"
        },
        "index": 0,
        "name": "email-mbox"
      }
    ]
  }
}'

Remove the marketingCloudVisitorId property if you don't have a known ECID for the person receiving the email.

 

View solution in original post

2 Replies

Avatar

Employee Advisor

@Michael_Soprano

Good catch! That second one is referring to the older API and should be updated. I'll submit a ticket to the documentation team to have it corrected. In the meantime, use the delivery API example from your #1 for Recommendations via email with delivery API method.

Avatar

Correct answer by
Employee Advisor

Here's a sample Delivery API that could work: 

 

curl -X POST \
  'https://clientcode.tt.omtrdc.net/rest/v1/delivery?client=clientcode&sessionId=9979fc32c26d49df8e04a6d734' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
  "context": {
    "channel": "web"
  },
  "id": {
    "tntId": "4920148a9a9f4061a3aff5cfe5be1cb3.35_0",
    "marketingCloudVisitorId": "54485242253040699773642612187575264854"
  },
  "property": {
    "token": "b468a242-64a4-32a0-ca0c-890bddd78789"
  },
  "execute": {
    "mboxes": [
      {
        "parameters": {
          "entity.id": "article-123",
          "entity.event.detailsOnly" : "true"
        },
        "index": 0,
        "name": "email-mbox"
      }
    ]
  }
}'

Remove the marketingCloudVisitorId property if you don't have a known ECID for the person receiving the email.