Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
SOLVED

Actions in Journey -> requesting Open AI API to get image

Avatar

Level 8

I would like to get dynamically in my mailing image from Open AI API. I configured everything in Open AI and in Postman I get url of the image. However in journey test mode it looks like there is nothing in response?? What do you think? Any suggestions? Then I would like to put response into email template in order to debug but nothing shows up on a templa and in the test mode log. 

Michael_Soprano_0-1734434548004.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

looks like the response is an array object, you can access it on the following lines

{{#each context.journey.actions.<actionId>.data as |res|}}
 {{res.revised_prompt}}
<br/>
 {{res.url}}
{{/each}}

 

View solution in original post

10 Replies

Avatar

Employee

I believe the response payload is configured in the custom action response. If so, can you try accessing the response attributes in a condition and see if you notice it in the logs ?

Avatar

Level 8

Sorry that my response is so late

I am not able to put the Custom Action response directly in the email template without condition?

I put the response in the email template directly but its empty and in the log there are no errors

Michael_Soprano_1-1735395582569.png

I do not see any response in the log in Test Mode

Michael_Soprano_0-1735396116244.png

 

 

 

Avatar

Level 8

I use the Condition node as you said to check if response from the server == 200 

In the Logs I see the response from API:

Michael_Soprano_0-1735413892869.png

However its still not put into email template. Checked multiple times. How to debug further?

Avatar

Employee

Can you share how the response attributes are being accessed in the email message ?

Avatar

Level 8

Is this response from API (as JSON) is already parsed to a string?

Michael_Soprano_0-1735760737901.png

 

Avatar

Correct answer by
Employee

looks like the response is an array object, you can access it on the following lines

{{#each context.journey.actions.<actionId>.data as |res|}}
 {{res.revised_prompt}}
<br/>
 {{res.url}}
{{/each}}

 

Avatar

Level 8

My mistake, did not notice thats array ......

Thank you and happy new year!

Avatar

Community Advisor

@Michael_Soprano 

When was the custom action created? I observed a similar issue with a custom action created a couple of months ago. As a fallback option, I switched to using a data source (refer to: Configure Data Sources for Journeys).

However, I recently noticed that responses can now also be personalized in emails via custom actions. I would recommend creating a new custom action from scratch if the existing one was created a couple of months ago

Avatar

Level 8

Happy new year!

It was created few days ago. I use Custom Action as I think its more flexible for my use-case....

What is the practical difference between Custom Actions and Data Sources???

Avatar

Community Advisor

@Michael_Soprano 

In the initial release, the custom action feature in AJO supported only the POST method, while Data Source was the primary way to retrieve information from third-party systems into AJO.

With recent updates, custom action now supports the GET method, making it possible to fetch data directly from third-party systems. However, during testing, I observed a personalization issue with the custom action response, which did not occur with Data Source responses.

Data Source is specifically used to bring AEP data into AJO. Beyond this, custom action can perform the same functions of Data Source.