11-06-2014 02:18 AM - edited 03-14-2019 02:05 PM
Hello,
I need to develop a script which will collect some information about the caller (calling number etc) and send it in an HTTP request to an external server.
Can someone please share a working example of how to send a HTTP POST from the UCCX script?
I spent two hours googling it and couldn't find anything..
11-06-2014 02:48 AM
Hi,
take a look at the Create URL Document step. It supports both GET and POST.
G.
11-06-2014 06:17 PM
Thanks, I tried it but didn't see any result. Does this Create URL Document step actually send request to the server, or do I need to execute another step (like Send HTTP Response) after it?
Also, what if my web server requires authentication - where do I specify login and password?
11-06-2014 11:50 PM
Hi,
the Create URL Document step creates a reference object only. As soon as you call a method of that object, the HTTP request would be issued (actually, any time you call a method on that object, a HTTP request is issued). This is relatively easy, you should do something with the variable representing this object. The easiest method of this would be to use the Cache Document step.
About authentication: what sort of authentication is that, HTTP Basic? No authentication is supported out of the box in UCCX but there might be a workaround - can you please tell us the license level of your UCCX (Standard, Enhanced, Premium)?
G.
11-07-2014 04:16 AM
Hi,
This is for a future project, I don't have full details yet. License level should be either Enhanced or Premium. I'm currently running tests on the system with Enhanced license.
I tried the following test script and it works:
d=Create URL Document("http://somepage.com")
d=Cache Document(d, 10 KB)
I received binary content of the page in variable d. So looks like I'm on the right track. But still can't figure out how to perform authorization (HTTP Basic).
11-07-2014 04:52 AM
Hi,
I am afraid the auth part would not be possible without additinal coding (in Java).
I am thinking of a workaround but it might need some additional research. I will try it and post back.
G.
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