Page 1 of 1

Calling an API and getting result in a flow

Posted: Wed Oct 06, 2021 2:29 pm
by matthew.hearne
I am looking into how we can call an API, and then get the result to use in a flow (assume as XML).

I can write a PHP script (which is using cURL) to run on a website to do this, which as an example just calls an API to get an exchange rate, and then returns some XML which contains the Country code and Exchange Rate.

I'm not sure how I would write something similar to work in Switch though.

Does anyone have an example flow they could share that does something similar, that I can have a look at?

Re: Calling an API and getting result in a flow

Posted: Thu Oct 07, 2021 10:44 am
by freddyp
If it is a simple HTTP call to a web service to get a result then use the "HTTP request" element.

Re: Calling an API and getting result in a flow

Posted: Thu Oct 07, 2021 10:51 am
by jan_suhr
There is an app that can get messages from a webserver and show it in the Switch messages window.

It uses the Switch API and PHP-scripts on the webserver and sends Webhooks to Switch.

https://www.enfocus.com/en/appstore/pro ... ok-warning

In the documentation you can see how to setup the webserver to work with that.