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": "myemail@mail.com"
}​​
}​​

please what am I doing wrong? Thanks

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": "myUser@mydomain.com",
    "attributes": {
      "UserAttribute_1": "value_1",
      "UserAttribute_n": "value_n"
    }
  }
}

optionally also without attributes

{
  "definitionKey": "abcde",
  "recipient":
  {
   "contactKey": "subscriberkey12345",
    "to": "myUser@mydomain.com"
  }
}

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.