06-16-2017 06:46 AM - last edited on 03-25-2019 07:31 PM by ciscomoderator
Does anyone have an example or experience with REST/JSON post to an external webserver app (not on CCX server/cluster)? I need to get two strings of data to a web server from my CCX application/script.
I have the MAKE REST Call setup with the url and params but it fails every time and I'm not sure how to debug it.
thanks!
06-16-2017 11:58 AM
I'm pretty good with this, so I'll give it a shot. What can you share with us about your setup/attempt?
06-16-2017 12:32 PM
Hey Anthony, thanks for the offer! I'll share what I have so far -- basically I'm emailing the "message" now - we have a back end system that will take the email and parse it and then use the data for the alternate message delivery.
We want to post it to a new web app being developed with REST/JSON. ...
06-16-2017 12:55 PM
I think we may have an idea - http vs https. our web app isn't allowing http right now.... CCX won't do https right?
06-16-2017 12:58 PM
So, first thing first, you're using HTTPS on that target server, and so UCCX will have to trust the Issuing CA of that SSL cert. Did you take care of that already? You will need to upload the CA cert to the Tomcat-Trust of UCCX.
The script uses the Tomcat-Trust keystore under OS Administration. This changed in version 10.
See here, scroll down a bit, or search the page for "keystore"
https://supportforums.cisco.com/blog/12049551/community-tech-talk-cisco-unified-contact-center-express-uccx-version-100-upgrade
06-20-2017 07:46 AM
06-22-2017 02:33 PM
First, Why are you using the Create File Document and Cache Document steps? If you simply need to refer to a document in the repo, just create a Document variable with a value of DOC[filename]. Then, whereever you reference it, the contents will be used. You might have to cast it to a string first, which is like this
(String) myvariablename
Second, most REST based POST take body and not a parameter. I see you're putting your document in the parameters, and you might need to make it the body.
Can you confirm this with the REST server documentation or admin?
Otherwise, simply delete you parameter and move it into the Body.
Also, if you can, make it work in a REST client outside of the Editor first, to figure out things like this, then move it into the editor. E.g., Firefox Plugin RESTED
07-05-2017 07:44 AM
So I changed my script to be:
dJCW Create file ("JCWReport.txt) - Get's the file from the Repo
Set sBody = dJCW - Sets the file contents to a String variable
Make Rest - I deleted the Parameter and sBody is in the Body doing a Post
I get error 405 Method not allowed
Any ideas?
07-10-2017 06:13 AM
So I the web server admin finally got the permissions all corrected. Now when I run the REST it comes back with success however, the txt file is not updated. I know I am missing something simple here, but I dont see it.
JB
07-06-2017 05:56 AM
I am actually trying to take a document from the Repo and put it on a web server.
Right now I can GET and xml file from the web server using the Make Rest, but can not GET a txt file. Also, I can not POST anything to the web server.
In FF RESTED I can Get both the xml and txt from the web server. I still have not figured out how to POST.
JB
10-10-2018 01:16 AM
Hello Anthony,
I'm trying in my uccx script to refer to a json document in the repository but I'm getting the below error in the MIVR logs.
Line 177: 5857808: Oct 09 17:09:11.529 EEST %MIVR-SS_TEL-3-EXCEPTION:com.cisco.app.InvalidApplicationException: unable to preprocess config variables definition for script: SCRIPT[SaradarIVRScriptFinalV7.aef]; nested exception is:
Line 178: 5857809: Oct 09 17:09:11.529 EEST %MIVR-SS_TEL-3-EXCEPTION: com.cisco.script.InvalidScriptException: not a config variable: 'dOBTemplateDocument
Line 191: 5857822: Oct 09 17:09:11.529 EEST %MIVR-SS_TEL-3-EXCEPTION: com.cisco.script.InvalidScriptException: not a config variable: 'dOBTemplateDocument
Line 205: 5857836: Oct 09 17:09:11.530 EEST %MIVR-SS_TEL-7-UNK:[MIVR_SS_TEL_PORT_QEXE_99913-58-6-TERM_CONN_EV:99913] CallImpl: Call.aborting(com.cisco.app.InvalidApplicationException: unable to preprocess config variables definition for script: SCRIPT[SaradarIVRScriptFinalV7.aef]; nested exception is:
Line 206: com.cisco.script.InvalidScriptException: not a config variable: 'dOBTemplateDocument) JTAPICallContact[id=1765,implId=224174/1,state=STATE_ACCEPTED_IDX,inbound=true,App name=SaradarCallBackScript,task=null,session=25000001783,seq num=0,cn=99905,dn=99905,cgn=77777,ani=null,dnis=null,clid=null,atype=DIRECT,lrd=null,ocn=99905,route=RP[num=99905],OrigProtocolCallRef=0000000000036BAE011558E700000000,DestProtocolCallRef=null,TP=99913]
Line 232: 5857862: Oct 09 17:09:11.536 EEST %MIVR-SS_CM-7-UNK:[MIVR_SS_TEL_PORT_QEXE_99913-58-6-TERM_CONN_EV:99913] ICDContactAdapter: ICDContactAdapter:contactAborted - This call was aborted. The exception is com.cisco.script.InvalidScriptException: not a config variable: 'dOBTemplateDocument
Line 247: 5857877: Oct 09 17:09:11.537 EEST %MIVR-SS_RM-7-UNK:[MIVR_SS_RM_RmMsgProcessor-93-0-RmMsgProcessor] RsrcMgrMsgProcessor: Processing msg: SessionTerminatedMsg (Rsrc:null ID:224174/1 Type:IAQ Cause:INVALID Abort Exception:com.cisco.script.InvalidScriptException: not a config variable: 'dOBTemplateDocument)
Attached you can find screenshots from my script. I would appreciate if you can take a look at them and advise on what I'm doing wrong.
Thank you in advance.
Lara
04-30-2018 02:24 AM
Hi Mr.Anthony
My issue is i want to post amount to particular web server, and i dont have any idea about it i created url but not getting how to post particular value to that rest url using make rest call.
Please help me with this.
Thank you
Pranali
10-01-2020 12:46 PM
how to pass the JSON body in make rest call step?
if i have to pass below info , how can i do it in make rest call step
10-12-2020 04:18 PM
Hi Ravi,
Is your problem solved? If yes, can you share the solution?
03-10-2021 03:56 PM
Ravi,
Were you ever able to get this to work?
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