1

When the custom Activity execute / publish endpoints are called, and the JWT is decoded, there isn't any contextual information for which organization sent the call.

This app could be used by many orgs, and I was wondering how to get this information.

The JSON payload looks like:

{  
   inArguments:[  
      {  
         Task:[  
            Object
         ]
      }
   ],
   outArguments:[  
      {  
         success:true
      }
   ],
   activityObjectID:'1234-1234-1234-12341234',
   journeyId:'1234-1234-1234-12341234',
   activityId:'1234-1234-1234-12341234',
   definitionInstanceId:'1234-1234-1234-12341234',
   activityInstanceId:'1234-1234-1234-12341234',
   keyValue:'test@icloud.com',
   mode:0
}

For reference, the Marketing Cloud app provides an orgId field in the JWT to provide context, but these execute / publish endpoints by default don't seem to provide the same context.

4

The solution we managed to get the fuel refresh token on the frontend with postmonger (https://salesforce.stackexchange.com/a/185155/61173)

Then we used the response from the API (we used https://www.exacttargetapis.com/platform/v1/tokenContext instead for the API endpoint in the above post) to get the orgId and we sent it through the publish endpoint. Now any response that has activityId can map to the orgId (as publish has the same activityId)

"publish": {
      "url": "",
      "body": "",
      "verb": "POST",
      "useJwt": true
    }

...

function save () {
    ...
    payload['configurationArguments'].publish.body = JSON.stringify({fuelToken: fuelToken})
    ...
  }

​​​​​​​

3
  • can you please show your api callout code we are trying to do something similar in our project.what's your host in the api callout ? Apr 29 '20 at 8:11
  • can please show you request, that will be helpful Apr 29 '20 at 8:32
  • @ItaDeustch, Any luck with this work!. I'm trying similar in my project too. Nov 10 '20 at 17:52

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.