cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

1865
Views
15
Helpful
20
Replies
Highlighted
Beginner

Make REST Call??? CCX 10.6,1

Working on a new project that will require pulling information from a database via an API.  The way this "should"work is that when a call comes in, the script grabs the ANI/CLID information and then makes the initial call to the API to see if the callers number is in the database, and if that is true then pull additional information about them like account number, zip code, and name.  Depending on the option they choose it will need them to verify this additional information by entering it through their telephone keypad.  If they are able to verify at least 2 additional items, then allow them to hear their account balance or change/set the pin associated with their account.  I have attempted to setup the "Make Rest Call" in the editor.  I have the URL, and  but not sure what I'm doing and other than the URL, I haven't got a lot of time to get this working.  If anyone can point me in the correction it would be most appreciated.

Everyone's tags (4)
20 REPLIES 20
Beginner

Re: Make REST Call??? CCX 10.6,1

I am attempting this on my own, and have tried several things things in the properties of the Make REST Call.  According to the developer that wrote the API, the script wont need a userid/pw to talk to it.  I have tried leaving those fields blank but get the error User ID Lexical Error "Unable to parse expression; no formula entered (line1, col: 1).  If I create String variables for both of them and leave them blank it allows me to save the properties.  Is this going to work?

Re: Make REST Call??? CCX 10.6,1

Just put empty double quotes in both parameters; no need to create variables.
VIP Advisor

Re: Make REST Call??? CCX 10.6,1

I'm 90% certain you shouldn't put a String literal in these fields, and Cisco mentioned that somewhere: documentation, forum post, or Spark room. That's the trouble with so many channels of communication, finding information. I'll see if I can get a Cisco person to look at this post and comment.

 

UPDATE: It's just for the Response fields (Response, Status Code, Status Detail).  The Request fields can be empty String literals.  Well, not the URL one of course.  :P

 

In the meantime, I'd like to share what I do, as an option for anyone else looking at this post and not wanting to create 8 new variables for their Make REST Call step; it uses a single String Array.

uccx-make-rest-call-example-with-string-array.png


Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Beginner

Re: Make REST Call??? CCX 10.6,1

Thanks for your assistance, however not sure where to enter the "new String { "variables and do I also need to create variables in the script and if they arent String values, what should they be.

VIP Advisor

Re: Make REST Call??? CCX 10.6,1

Oops!  I assumed you knew what that was hinting at.

 

Does this help?

 

uccx-script-string-array-example.png


Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Beginner

Re: Make REST Call??? CCX 10.6,1

Thanks for the clairification.  I have written many scripts but none involving a rest call to an API.  I am still working with the API team to get this working, once I have more information on this I will update this post.

Beginner

Re: Make REST Call??? CCX 10.6,1

Looking at this a lot closer I think I follow the logic here, but still a bit of confusion on my end.  If when I make the REST Call, I need to read data from multiple fields in the DB, can I do this in 1 step or does it require multiple rest call statements.  I need to use the ANI as the initial lookup, then when it does the API call get the following values: alias, dob, and zipcode.  Also, if it doesn't find the ANI when it makes the call, I need to set another flag so that the call is sent into a different area/queue.

Beginner

Re: Make REST Call??? CCX 10.6,1

Now I understand what you have been talking about, guess I needed to stop looking at it so closely.  I used your guide to setup the REST variable, when I click the apply button in the editor I get an error "Unable to parse expression; (line 27, col 5).  This is the end of the file, is it supposed to have something after the double quotes?

Beginner

Re: Make REST Call??? CCX 10.6,1

Figured out the issue, forgot the last line of }.  Now I think it should work.

VIP Advisor

Re: Make REST Call??? CCX 10.6,1

I'm glad you got it figured out!

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Beginner

Re: Make REST Call??? CCX 10.6,1

Now Im a little confused, I needed to do another Make REST call in one of the subflows.  I followed the same format as the first one, changed the name of the String[] variable with no issues, then went to setup the properties for the Make REST call and it fails every time on the first line at the end of the name(0) stating "Unable to parse expression; Counldn't repair and continue parsing on token #LPAREN'('(line 1, col: 5)

 

Any idea what this error means?

VIP Advisor

Re: Make REST Call??? CCX 10.6,1

Reads like a syntax error.  Paste the variable contents here or a full screenshot showing it all.


Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Beginner

Re: Make REST Call??? CCX 10.6,1

Attached are the  variable and the Rest Call with error

Beginner

Re: Make REST Call??? CCX 10.6,1

Here is the rest of the variable string array:

new String[] {
// HTTP Request Section

// Index 0 - URL
"http://loyaltyivrqa/api/IVR/validateUser",

// Index 1 - User ID
"",

// Index 2 - Password
"",

// Index 3 - Content-Type
"application/json",

// Index 4 - Body

// HTTP Response Section

// Index 5 - Response
"",

// Index 6 - Status Code
"",

// Index 7 - Status Detail
""
}

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards