POST request header

The request must contain a “Content-Type: application/json” header.

You must add a charset, for example utf-8. Note that this value depends on the REST application you are using.


-X POST \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>' \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Content-Length:79' \

POST request body

The event data are contained inside the JSON POST body. The event structure depends on its definition. The API preview button in the resource definition screen provides a request sample. Refer to this section.

The following optional parameters can be added to the event content to manage the sending of transactional messages linked to the event:

  • expiration (optional): after this date, the sending of the transactional event will be cancelled.
  • scheduled (optional): from this date, the transactional event will be processed and the transactional message will be sent.
NOTE
The values of the “expiration” and “scheduled” parameters follow the ISO 8601 format. ISO 8601 specifies the use of the uppercase letter “T” to separate the date and time. It can however be removed from the input or output for better readability.

Response to the POST request

The POST response returns the transactional event status at the time it was created. To retrieve its current status (event data, event status…), use the Primary Key returned by the POST response in a GET request:

GET https://mc.adobe.io/<ORGANIZATION>/campaign/<transactionalAPI>/<eventID>/

Sample request

POST request to send the event.


-X POST https://mc.adobe.io/<ORGANIZATION>/campaign/mcAdobe/EVTcartAbandonment \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>' \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Content-Length:79'

{
  "email":"test@example.com",
  "scheduled":"2017-12-01 08:00:00.768Z",
  "expiration":"2017-12-31 08:00:00.768Z",
  "ctx":
  {
    "cartAmount": "$ 125",
    "lastProduct": "Leather motorbike jacket",
    "firstName": "Jack"
  }
}

Response to the POST request.


{
  "PKey":"<PKEY>",
  "ctx":
  {
    "cartAmount": "",
    "lastProduct": "",
    "firstName": ""
  }
  "email":"",
  "scheduled":"2017-12-01 08:00:00.768Z",
  "expiration":"2017-12-31 08:00:00.768Z",
  "href": "mcAdobe/EVTcartAbandonment/<PKEY>",
  "serverUrl":" https://myserver.com ",
  "status":"pending",
  "type":""
}