cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1284
Views
0
Helpful
1
Replies

UCCX Create URL Document for REST web service

Michael Miu
Level 1
Level 1

Hello UCCX Community,

 

How would I set my parameters in the Create URL Document for the following REST web service?  The two classes (context & data) is throwing me off.  Thank you!

 

POST http://address/CreatePhoneCall

 

Input :

{

  "context": {

  "language":"English",

},

  "data":{

  "callId":"999999"

  }

}

 

Output:

{

  "phoneCallId": "abcdefghijklmnopqrstuvwxyz"

}

1 Reply 1

Tony Cilli Jr
Level 1
Level 1

Michael,

What version of UCCX are you running?

If you're running at least version 10, there's now a 'Make REST Call' step you can use in the script editor under the 'Document' folder.

With it, you can do GET, POST, PUT, or DELETE.

From there, you can add your parameters to map to variables. So if you want to POST the Caller ID of an inbound call to your web server, you would do the following:

  • Use 'Get Enterprise Call Info' to map the Calling Line ID to a variable (i.e CallerID)
  • Add the 'Make REST Call' step
    • Enter the URL for your Web Service
    • Add the authentication information if necessary
    • Set the Content Type ("text/html", "application/xml", etc.) - your web developer should know this
    • Set the Method to POST
    • Add a new Parameter with name "callid" and the Value as the variable you mapped Caller ID to (i.e. CallerID)
    • Map the Body, Response, Status Code, and Status Detail fields to String Variables you create (i.e. body, response, status_code, status_detail) - these will be what the output/return data from your web server gets put into

Hopefully this helps you. If you're running a pre-10.x version of CCX, then you'll probably need to follow similar steps as above with the Create URL Document step - just set it to Post, set your URL, parameters and specify a Document variable.

I believe with the Create URL Document step though, you'll need to follow it up with a 'Cache Document' step before it will actually reach out to the web server.

Hopefully this helps!

-Tony