I am working on custom activity where I need to identify the account (user) details from which the request came to the custom activity REST APIs.
I thought setting "useJwt": true
in the config.json
will send the account details but it only sends the activity API parameters in the JWT
token.
I have used the JWT
token received in POST body of the Hub Exchange app to retrieve the account details as explained in the docs: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-app-development.meta/mc-app-development/explanation-decoded-jwt.htm
But, for custom activity I can't able to find a way to get the account details as I got in Hub Exchange API.
config.json
{
"workflowApiVersion": "1.1",
"metaData": {
"icon": "img/img_1.png",
"iconSmall": "img/img_2.png",
"category": "message"
},
"type": "REST",
"lang": {
"en-US": {
"name": "Test custom activity",
"description": "Testing custom activity"
}
},
"arguments": {
"execute": {
"inArguments": [
{
"firstName": "{{Contact.Attribute.DE_NAME.FirstName}}"
},
{
"lastName": "{{Contact.Attribute.DE_NAME.LastName}}"
},
{
"emailAddress": "{{Contact.Default.Email}}"
}
],
"outArguments": [],
"url": "https://xyz.ngrok.io/activities/execute",
"verb": "POST",
"body": "",
"header": "",
"format": "json",
"useJwt": true,
"timeout": 10000
}
},
"configurationArguments": {
"applicationExtensionKey": "test-activity-custm-wwq",
"defaults": {
"activity": "0"
},
"save": {
"url": "https://xyz.ngrok.io/activities/save",
"useJwt": true
},
"publish": {
"url": "https://xyz.ngrok.io/activities/publish",
"verb": "POST",
"body": "",
"useJwt": true
},
"validate": {
"url": "https://xyz.ngrok.io/activities/validate",
"verb": "POST",
"body": "",
"useJwt": true
},
"stop": {
"url": "https://xyz.ngrok.io/activities/stop",
"useJwt": true
}
},
"wizardSteps": [
{
"label": "Select anything",
"key": "1"
},
{
"label": "Confirm Settings",
"key": "2"
},
{
"label": "Save Settings",
"key": "3",
"active": false
}
],
"userInterfaces": {
"configModal": {
"height": 250,
"width": 600,
"fullscreen": false
}
}
}
Please help me to get account details of the account requesting the custom activity API.
Thanks.