02-02-2020 12:54 PM - edited 02-02-2020 12:59 PM
First-time attempt at this... I'd really appreciate some help getting a (seemingly simple) "Make REST Call" step working... I've spent a lot of time looking for examples online but nothing really helped. I feel like I have two left thumbs - I can never even get the step properties correctly configured so that the editor would accept the step.
Basically, a call to our helpdesk hotline is supposed to automatically open a helpdesk ticket via that application's REST API. I know that the API is working great, as I have been able to successfully test it using cURL:
curl -F "<paramter1name>=<parameter1value>" -F "<parameter2name>=<parameter2value>" -u <username>:<password> http://<helpdeskAPIfullURL>
The API then returns a basic XML response (which we don't even need to use any further in the UCCX script - just listing it for completeness):
<?xml version="1.0" encoding="UTF-8"?> <request> <xRequest>some expected response here</xRequest> </request>
Would anybody be so kind and show me an example how to correctly set the properties of the Make REST Call step so it works like the cURL command line above?
Thanks a lot for your help!
Solved! Go to Solution.
02-03-2020 05:47 PM
Hello @schm196
Please find in attachment a sample demo script that shows the usage of the Make REST Call configuration that should give you the same results as CURL command. I have put some additional comments into this script so it should be clear for you to understand how you need to put your config.
02-03-2020 09:04 AM
I think I can be more specific about my challenges now:
How do I put several parameter names and their values into the "Body" field of the Make REST Call step? I have no clue about the gritty details of the expression needed... curlies, brackets, quotations, slashes, etc. Again, it simply needs to get across what is shown above in the successful cURL command line.
Thanks again for looking into this!
02-03-2020 05:47 PM
Hello @schm196
Please find in attachment a sample demo script that shows the usage of the Make REST Call configuration that should give you the same results as CURL command. I have put some additional comments into this script so it should be clear for you to understand how you need to put your config.
02-03-2020 07:43 PM
Thanks a lot, Marek. It is working now!!!
Looks like I violated the KISS principle (I didn't keep it simple, stupid). I had everything just like in your example, with the exception of the simple body string connecting the various keys using ampersands.
If I may, a bonus question: The web POST method returns an XML response. I can see it fine in the flat "String" variable but would rather have it returned into an "XML Document" for further parsing if ever required. What's the easiest way to get this done?
Thanks again, much appreciated!
Matthias
02-03-2020 09:23 PM
Make REST Call allows you only to pass responses as strings. You can not use Document type objects. If you want to parse the response - you will need to parse it. This can be done by Set element.
02-04-2020 08:08 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide