3

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": "[email protected]", "SubscriberKey": "[email protected]", "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

1 Answer 1

3

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

2
  • 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) Jun 12, 2018 at 18:28
  • it's magic man!
    – mario ruiz
    Jun 12, 2018 at 19:45

You must log in to answer this question.

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