cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
5245
Views
15
Helpful
22
Replies
Highlighted
Beginner

UCCX 10.6 - Make REST Call

Hi everyone,

I'm currently struggeling with the "Make REST Call" step in CCX Script.
Within the REST step properties, we can select the Method and Parameters.

I need to do a POST to another database.
Problem is that when I add parameters, then these will be added to the Request URI instead to be put in the body. 

However, when I want to add the "parameters" in the body field then script editor doesn't allow me to do so.
I'm even not sure which format CCX is expecting there as everything I've tried has been rejected by the Editor...

Compared to the Postman Code, where we have the Body included, it's not working correctly with the CCX script. 
Here's a snippet from Postman in code format: 

POST any address HTTP/1.1
Host: any host
Authorization: Basic 
Cache-Control: no-cache
Postman-Token: xxxxx
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="messageTypeCode"

any value
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="originTelNumber"

any number
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="targetUser"

any user
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Compared to the actual Request by CCX, it is looking in Wireshark the following: 

Request URI Query: messageTypeCode=any value&originTelNumber=any number&targetUser=any user3DCall+Manager+User%2Cid%3Danyuser%2Cauthenticated%3Dtrue%5D

How do I get these "content-disposition" fields above into the actual POST request by CCX Script correctly?

Any Idea? 

Thanks in advance
Michael

22 REPLIES 22
Highlighted

Hi Chintan, 

thanks a lot!! 

The function is now working! :)

Two things... I had also to add the "Accept-Encoding" Header to the script as well as adding another line seperator, before the actual values are written. 

Now, I'm fighting with another scenario... because, this request was now to search for customer information, open a call ... but now I need to send the same request (different in type), once the call is finished or the callee hangs up. 
Any idea how I can stay on the script instead of dropping out of the Script, once the call is established? 

I am using the Select Resource > Connected Step as the time when the first request will be sent. Once call is established, the script goes through the rest and reaches End step. In this between I have the CallEnd request but it shouldn't send it directly, instead it should wait until the call is closed.

Highlighted

I dont think the call end function is something you can do from UCCX script point of view, i will do some more research on this if this can be done from script.

But i think you can do it from Agent Desktop client, what is the Agent Desktop you are using? CAD or Finesse?

Highlighted

They are using Finesse. 

Highlighted

then it would be easy to do it i guess:

In Cisco Finesse Administration --> Workflow --> create a workflow which kicks when call ends.

in the Action perform HTTP Request --> POST and define the parameter body you are looking to use. you can also use call variable to add data to the body dynamically.

and assign the workflow to Agent Team.

I will have working sample for you and meanwhile you can also explore the option.

Highlighted

Hi Chintan,

thanks a lot again! 

This worked great and I am now able to do request for incoming call as well as call end. Great! 

I think we can see this case as closed :)

Many thanks again!!

Highlighted

glad that its working as you expected and yes we can close the thread :). don't forget to rate all helpful posts.

Highlighted

unable to parse expression,could't repair and continue parsing on token #COLON ' :' (line1,col:5) unable to parse expression,invalid identifier:http (line1,col:1)

I am getting these error while adding the url in Make Rest Call.

Highlighted

You have to create a String variable for each of the fields at the bottom of the properties dialog window (E.g., Body). It's mandatory.