Expand my Community achievements bar.

Join expert-led sessions on Real-Time CDP & Journey Optimizer designed to boost your impact.
SOLVED

Putting variable in Custom actions POST Body payload

Avatar

Level 7

Hi all,

 

We are just getting onboarded into AJO, and we started building test journey to test a few things. One of the thing I am testing is to for AJO to read a segment, and send a POST Call to a slack integrated channel to display a simple message.

 

The Slack POST endpoint looks something like this: https://hooks.slack.com/services/xyz and accepts a BODY data:

{text: "abc"}

 

The test is to display "Abc" as a message in the slack channel, and this has been successful.

 

I am wondering if there's a way to add variable values (say, I want to add a profile attribute value, the ID - all readily configured in data sources) into the POST body?

 

The end output I am looking for is something like this: "text: "Account:" & @IDvariable & "received the message"

Output: Account 123 received the message.

 

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@akwankl, You should be able to include that as part of the payload (variable) that you defined in the custom action. Once you defined the AccountID variable use the custom action within the journey to map it to the ID attribute on the AJO. For example with this, I have included email, firstname, lastname, and ID as a variable. 

{
"email": "abc@test.com",
"Data": {
"FirstName": "Test",
"LastName": "AJO",
"ID":"1234"
}}

SatheeskannaK_1-1696020279289.png

 

 

Thanks, Sathees

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

@akwankl, You should be able to include that as part of the payload (variable) that you defined in the custom action. Once you defined the AccountID variable use the custom action within the journey to map it to the ID attribute on the AJO. For example with this, I have included email, firstname, lastname, and ID as a variable. 

{
"email": "abc@test.com",
"Data": {
"FirstName": "Test",
"LastName": "AJO",
"ID":"1234"
}}

SatheeskannaK_1-1696020279289.png

 

 

Thanks, Sathees

Avatar

Level 2

Hi Sateesh Kumar,

I am trying to use custom action to post a third party api.

part of request payload we are trying to pass couple of profile attributes to that api.
when we try to map the variable with profile attributes, I am bot seeing all unified profile attributes.
Only limited attributes are appearing. what could be the cause?

Thanks

Srinivas

Avatar

Community Advisor

@srinivasadevar1 Make sure to enable the attribute on the experience platform data source. Path to get there, Administration -> Configuration -> Data sources -> Experience platform -> Enable the necessary attribute(s) in the field group to be used in the journey.

Thanks, Sathees

Avatar

Level 2

Thank you for quick response @SatheeskannaK
I was in impression that unified profile attributes by default will be available just like email designer.

Thank you.