2

Same request works from POSTMAN but I'm getting in troubles when trying curl.

curl -d @al.json -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer this_is_a_valid_token" -X POST https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:this_is_a_valid_external_key/send

And the al.json file is

{"To": {"Address": "valid@email.com", "SubscriberKey": "valid@email.com", "ContactAttributes": {"SubscriberAttributes": {"Attr": "attr1", "firstName": "Mother Teresa" } } }, "OPTIONS": {"RequestType": "ASYNC"} }

The response is:

{"requestId":"12a96292-03d1-4a0d-9e3f-1htf4512aea1","responses":[{"recipientSendId":"","hasErrors":true,"messages":["InvalidOrMissingTo"]}]}

I've reviewed MessageDefinitionSends Rest API successful response but never sends email and Rest API says email is queued but never shows up in web frontend or sends email but can't fihure out what's wrong

2

I was using the incorrect Content-type ... It should be application/json

  • 1
    I just wanted to add that there are a few things that could cause this. The content-type is one but another is missing the body from the request. (p.s. @Mario, thanks for commenting on this after you found the solution; it saved me tons of time) – Jacob Kranz Jun 12 '18 at 18:28
  • it's magic man! – mario ruiz Jun 12 '18 at 19:45

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.