cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1136
Views
5
Helpful
5
Replies

UCCX 8.6 - how to send an HTTP POST from the script?

SMerezhko
Level 1
Level 1

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..

5 Replies 5

Gergely Szabo
VIP Alumni
VIP Alumni

Hi,

take a look at the Create URL Document step. It supports both GET and POST.

G.

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?

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.

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).

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: