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