01-13-2020 07:40 AM
Hi,
I try to use the UCCX script editor to make a REST call to azure MS Dyn but with Skript editor the response is "Client response status: 412" "java.net.NoRouteToHostException: No route to host (Host unreachable)". If I make the same REST call in postman or chrome browser I get a json response. there is no timeout issue because the response in Postman comes after 3 seconds and in skript editor the defualt is 5000ms.
The URL for my looks like the following:
Is it possible to make a REST call in script editor with subscription-key in URL or do I have to set this as header or as body?
How do I get my REST call working like in chrome browser or postman?
Thanks,
Tobias
01-13-2020 10:06 AM
Hi Tobias,
Yes you can execute REST GET request with query parameters in the URL link (including subscription-key). If you look a the screenshot that you have provided, you will see that it gives you ability to set the URL parameters.
To resolve the issue I would start with troubleshooting the 412 response. In general the 412 response is known as Precondition Failed. This error can be caused by invalid set of headers that send to Azure cloud. If the query works in Postman, that I would set the same set of headers in the Make Request for in UCCX script. HTTP 412 can also be sent by server indicating that the object that you re trying to modify has been changed and you need to pull it back (if tha API has some states). But if you are using GET method, I assume that you want to pull data from cloud.
Another clue that may be useful is the text description of the error: "java.net.NoRouteToHostException: No route to host (Host unreachable)". To verify this error you will need to login to UCCX CLI (as OS Administrator) and issue the command: utils network ping xxxxxxx.azure-api.net. This will check if the server is able to communicate with the cloud - it may be blocked by firewall. It will also tell you if the name can be resolved by UCCX server.
And last tip. If you are using HTTPS protocol you will need to upload the API server certs and add them to UCCX trusted store. Here is a text from Cisco doc (https://www.cisco.com/c/en/us/support/docs/customer-collaboration/unified-contact-center-express/118855-configure-uccx-00.html#anc13):
Third-Party Applications Accessible from Scripts If a UCCX script is designed in order to access a secure location on a third-party server (for example,
Get URL Document step to an HTTPS URL or a Make Rest Call to an HTTPS REST URL), upload the signed or
self-signed certificate chain of the third-party service to the UCCX tomcat-trust keystore. In order to obtain
this certificate, access the UCCX OS Administration page and choose Upload Certificate. The UCCX Engine is configured in order to search the platform Tomcat keystore for third-party certificate chains
when presented with these certificates by third-party applications when they access secure locations via script
steps. The entire certificate chain must be uploaded to the platform Tomcat keystore, accessible via the OS
Administration page, as the Tomcat keystore contains no root certificates by default. After you complete these actions, restart the Cisco UCCX Engine.
04-07-2025 01:21 PM
Hi Marek,
I have a pretty similar problem with our CUCX. I already have the certificate upload in the server and i still get a ""Exception during REST execution - GET Request". Also the ping to the API is good.
I have intended to set diferent header and parameters into the Make Rest Call in the script of CUCX without sucessfull.
Any idea what do i need here?..
Best regards.
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