HikaruOgata | 2023-02-17 16:42:58 UTC | #1
I would like to know how to call an external web page in POST format with an example.
Jason_Mathison | 2023-02-16 22:14:13 UTC | #2
You can start with a DevCast video https://www.youtube.com/watch?v=o4L6qOqWKdY&ab_channel=GenesysCommunity
or the documentation here: https://help.mypurecloud.com/articles/create-custom-action-integrations/
--Jason
HikaruOgata | 2023-02-16 23:49:09 UTC | #3
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? "}" }
Jason_Mathison | 2023-02-17 16:45:15 UTC | #4
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
SimonBrown | 2023-02-17 18:35:18 UTC | #5
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} } }" }
system | 2023-03-21 06:34:06 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 18436