0

I created my first transactional journey, token request is working but when I try to trigger it I am getting a 400 bad request. here is the request:

https://[subdomain].rest.marketingcloudapis.com/messaging/v1/email/messages/[email customerkey]

and here the body:

{​
"definitionKey": "[Event Definition Key]",
"recipient":
{​​
"contactKey": "000011111aaa",
"to": "[email protected]"
}​​
}​​

please what am I doing wrong? Thanks

1 Answer 1

2

I can confirm this works:

{{restEndpoint}}/messaging/v1/email/messages/{{$guid}}

Headers:

Content-Type: application/json
Authorization: Bearer {{accessToken}}

Body:

{
  "definitionKey": "abcde",
  "recipient":
  {
   "contactKey": "subscriberKey12345",
    "to": "[email protected]",
    "attributes": {
      "UserAttribute_1": "value_1",
      "UserAttribute_n": "value_n"
    }
  }
}

optionally also without attributes

{
  "definitionKey": "abcde",
  "recipient":
  {
   "contactKey": "subscriberkey12345",
    "to": "[email protected]"
  }
}

This looks pretty similar to your code, so maybe the error is inside your variables.

  1. Please ensure the [ ] are not physically in your code. "abcde" in my example is the event definition key of my journey.

  2. {{$guid}} in my example is a POSTMan standard to create a unique identifier for the sendout event, and is NOT the same as the email customerkey. This is a reference number that you set by sending the request for the sendout, not any existing IDs or key from inside SFMC.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .