About data actions

I would like to know how to call an external web page in POST format with an example.

You can start with a DevCast video

or the documentation here:

--Jason

Thank you for your reply.
I understand how to create basic data actions.
What I want to know is how to write a custom action.
Would it be written like this:

{
"requestUrlTemplate":"https://www.google.com/",
"requestType": "POST",
"headers": {
"Content-Type": "application/json"
},
"requestTemplate": "{" in JSON format? "}"
}

That looks like a reasonable starting point. Have you tried installing a custom web service data action integration and creating a new action in the UI? The only thing you have to do to get a basic custom data action to run in test mode is to set the requestType and URL.

--Jason

I tend to match the API json payload naming through the simple input contract, let GC do the work of building JSON.
Saying that, if names are different and/or you need object in object in the Input area you need to define yourself.
Your template is correct, example of entry in there would be;
This has a header key/value and a simple response showing a nested object for "survey".
You can't do this in the Simple mode.

{
"requestUrlTemplate": "https://yourapiendpoint",
"requestType": "POST",
"headers": {
"x-api-key": "${input.x-api-key}"
},
"requestTemplate": "{ "topicId": "${input.topicId}" , "stage": "call.end" , "survey": { "Required": ${input.surveyRequired}, "Type": ${input.surveyType} } }"
}

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.