1

I would like to change the status from "Draft" to "Approved" in an approval workflow for emails.

I tried to used this api call - POST /hub/v1/workflowitems/{workflowItemid}/transitions

JSON body -

{
"transitionid" : "Approved"
}

In response I have -

{
    "message": "No roles found for the current user",
    "errorcode": 20000,
    "documentation": ""
}

See the documentation here

For these calls, I use a server-to-server API Package with all the possible rights.

So my question is - how to give permission to my package to change the status of the workflow approval?

EDIT:

I finally found a solution. It seems impossible to approve an email with a server to server package. So I created a Marketing Cloud App package in order to authenticate with my user and get a token with the context of my user. Also I add to modify my call on - POST /hub/v1/workflowitems/{workflowItemid}/transitions

JSON Body -

{    
    "workflowItemId":{workflowItemid},
    "overrideNotificationId":9,     
    "transitionId":"approve" 
} 
New contributor
Pierre-Arnaud Huvey is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    Thank you @Niko for the editing ! Sep 15 at 9:20
  • 1
    The only way I was able to do this was to add the installed package app user to the approval team
    – EazyE
    Sep 15 at 13:29
  • Thank you for your feed back, How did you manage to add this user in the approval Team? In the UI, i can only add users (not package) and don't find any api call for this. Sep 15 at 15:56
  • I finally found a solution. It seems impossible to approve an email with a server to server package. So I created a Marketing Cloud App package in order to authenticate with my user and get a token with the context of my user. Also I add to modify my call on - POST /hub/v1/workflowitems/{workflowItemid}/transitions JSON Body - { "workflowItemId":{workflowItemid}, "overrideNotificationId":9, "transitionId":"approve" } Sep 17 at 10:06

Your Answer

Pierre-Arnaud Huvey is a new contributor. Be nice, and check out our Code of Conduct.

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

Browse other questions tagged or ask your own question.