Calling an API and getting result in a flow

Post Reply
matthew.hearne
Member
Posts: 24
Joined: Thu Dec 19, 2019 3:00 pm

Calling an API and getting result in a flow

Post 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?
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Calling an API and getting result in a flow

Post by freddyp »

If it is a simple HTTP call to a web service to get a result then use the "HTTP request" element.
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Calling an API and getting result in a flow

Post 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.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Post Reply