-2

I am trying to Inject a contact in journey builder as API Entry source from Sales cloud object to Marketing Cloud using Apex REST API callout. I have generated access token and defined required scope to the component. I am receiving 403 status code as response, and no contact is being added to DE. When I referred the SFMC API Documentation for 403 status code, it indicates, "HTTP/1.1 403 { "message": "The account does not have a required permission to access Email Subscribers."}. Also the same request works fine in postman. Any response is appreciated.

Here's my code snapshot.!

0

1 Answer 1

0

If you have a valid token, but you still get the 403, that means that the token is generated via an Installed Package (clientId / client Secret) without sufficient permissions to perform the operation.

You need to go to Marketing Cloud Setup, Apps, Installed Packages, find your installed package (probably by checking clientId) and assign permissions to the package.

As a best practice, assign as few rights as you need, don't just assign all.

Note that you need to regenerate a new token so that the change you made to the permissions takes effect. the permissions ("scope") is information stored in the token. Reusing old token = retrying with old permissions => will fail.

I am not 100 % sure what the minimum scope is for injecting to journey.

Presumably you will need:

Journeys:

  • Read, Execute, Activate/Stop/Pause/Resume/Send/Schedule
  • Lists and Subscribers: Read, Write

Potentially also:

  • Email: Read, Send
  • Data Extensions: Read

If you have determined the minimum permissions, feel free to share and I'll edit it in for posterity.

3
  • I edited the component and allowed few permissions, generated a new token. The response is still same. May 24 at 14:27
  • just to isolate: temporarily give ALL permissions to the package and retry with a new token. if that works, you know it's something with permissions, the question is just which one. May 24 at 15:35
  • After removing line 6, that sets header as Host, It worked. May 24 at 19:33

You must log in to answer this question.

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