I'm new to Salesforce and I've been trying to use the messageDefinitionSends endpoint to send a single email message. I started by creating an email message, a data extension and a triggered send. I saved, published and started the triggered send.
Then, using Postman, I requested an access token via https://myorgsubdomain.auth.marketingcloudapis.com/v2/token
and got the following:
{
"access_token": "sometoken",
"token_type": "Bearer",
"expires_in": 1079,
"scope": "email_read email_send email_write ...", (and others, removed for simplicity)
"soap_instance_url": "https://myorgsubdomain.soap.marketingcloudapis.com/",
"rest_instance_url": "https://myorgsubdomain.rest.marketingcloudapis.com/"
}
Then, I copied the token and used in the following request
POST /messaging/v1/messageDefinitionSends/key:123456/send HTTP/1.1
Host: myorgsubdomain.rest.marketingcloudapis.com
Content-Type: application/json
Authorization: Bearer sometoken
{
"To": {
"Address": "[email protected]",
"SubscriberKey": "[email protected]"
},
"Options": {
"RequestType": "ASYNC"
}
}
where 123456
is the external key for the triggered send I created previously. The recipient SubscriberKey equals the destination email address for this specific case (I confirmed via the SOAP API). When I POST the request I receive an empty response body with the HTTP response 404. I've also tried using the endpoint https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:123456/send
but I either receive a 404 or 401 response.
I'm struggling with this issue for a while now and I have no idea what might be wrong. Any suggestions?
Thanks.