2

I am trying to use the REST Call to fire a triggered send. My Package is a Server to Server and I am using the V2 for authentication and i get a bearer generated.

When I actually do the POST Call for the Triggered Send Definition I get the following message:

{ "message": "Insufficient privileges to complete this action.", "errorcode": 20002, "documentation": "" }

I am using this documentation as reference:

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/messageDefinitionSends.htm

I do a POST CALL to the following endpoint:

https://mc4MYENDPOINT.rest.marketingcloudapis.com/messaging/v1/messageDefinitionSends/key:Trigger Send - Cristina TEST/send

{
"From": {
"Address": "code@exacttarget.com",
"Name": "Code@"
},
"To": {
"Address": "myexample@gmail.com",
"SubscriberKey": "Cristina34646466464664644",
"ContactAttributes": {
"SubscriberAttributes": {
"First Name": "West",
"Booking": "its a test really"

}
}
},
"Options": {
"RequestType": "SYNC"
}
}

If i do either SYNC or ASYNC fails with the same message. I have tried different scope in the auth call but they all fail.

I tried:

"scope": "data_extensions_write" "scope":"email_write", "scope": "email_send",

In all of these instances it fail with that same message.

What do i need to change in the auth call to make this work?!

Giulietta

3

A couple possible issues:

1) Does the Installed Package whose credentials you are using to retrieve your auth token have permission to emails? Read, write, send, all?

As a note, I have seen in the past that updating permissions on Installed Packages does not actually propagate the permissions -- I believe this has been fixed, but it may be worth trying to create a new Installed Package and use its credentials to see if there is any change.

2) Is your MID enable for child BUs, and if so is the BU for which you are retrieving the OAuth token the same as the BU in which the Triggered Send resides?

Make certain you are specifying the proper MID in your OAuth call. An example is found in the last portion, Refresh Access Token, containing the JSON payload and properties required, here:

https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/access-token-app.htm

  • Thanks @Mike. I forgot to mention that indeed my package had the permissions for email ticked & the package was installed for the triggered send was in. I managed to resolve this by removing the Options from the JSON & also created an email as detailed here salesforce.stackexchange.com/questions/194416/… as i was getting a queued response; in my email i had the personalisation with %% %% not via amp script. Once i made these changes I was able to trigger this successfully. – Giulietta Jun 27 at 13:01
  • Worth mentioning that I have also changed the scope in the auth call to "scope": "email_read email_write email_send", – Giulietta Jun 27 at 13:04
0

Is the key of your triggered send actually "Trigger Send - Cristina TEST/send"? In that case you must URLencode the spaces and the slash as wel... url encoded it will be: Trigger+Send+-+Cristina+TEST%2Fsend

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.