Hi All, I am working on an app in Cloud UX. I would like to call a 3rd party API from my APP via https.request. However the call never succeed. There is no trace of the request on the 3rd party API side. It looks like the request never reaches th API.
When I check the developer tools in chrome I can see the following error message:
Uncaught (in promise) TypeError: Failed to fetch at module.exports.ClientRequest._onFinish
What could be the problem here?
Thanks
I am pretty sure this is an SSL certificate problem. So my question is what is the proper way of calling a 3rd party API hosted on a server on the local network.
Hi Gergelyv,
We provide a number of examples on how to use APIs from UI app at https://github.com/avid-technology
Please take a look at https://github.com/avid-technology/inews-notifications or https://github.com/avid-technology/cloudux-user-settings-example where UI App from a client machine is making API calls to cloudux on a local network.
Hi there Vadym,
I'm trying to do the same thing here. Looking at the inews-notifications example I noticed there were calls to the cloud-ux server to get an access token of some kind. That access token is then used in subsequent calls to something called the CTMS-registry. I tried out those calls to our cloud-ux server and while it works through postman, the plug-in fails to reach the server because of the CORS security feature on browsers. Also it seems like the example is a bit dated given the javascript libraries it uses (https vs axios like on other example projects). Someone on here mentioned Cloud-ux services as a way to make calls to external apis. Is that how this is done now?
-Kenneth
Hi Kenneth,
Are you using the same origin credentials? This is shown in the cloudux-user-settings-example.
You may need to create a connector (CloudUX service) under specific circumstances, but usually it is not necessary.
Making api calls over http doesn't require a connector. Most likely you just need to set cross origin header on your api server to allow calls from your CloudUX URL. e.g. Access-Control-Allow-Origin: *
BTW this is one of the reasons Trello example doesn't work anymore as they removed the wildcard possibility in their settings.
I see. Makes sense, thanks!
One possible cause of this issue is that there's a problem with the URL or endpoint you're trying to access. It's possible that the URL is incorrect or that the endpoint is not configured to accept requests from your app's domain or IP address. Double-check the URL and endpoint to ensure that they're correct and that you have the necessary permissions to access them. More over you read more guides at thenewsinsides.com.
developer.cloudflare.com
© Copyright 2011 Avid Technology, Inc. Terms of Use | Privacy Policy | Site Map | Find a Reseller