Integrating with third party services
Last updated
Was this helpful?
Last updated
Was this helpful?
There are two main ways of using third party services with Midio. If the service has a corresponding package in the , then that is a good place to go. If not, then it is usually not that diffcult to make the integration yourself using .
Http.Fetch
As long as the service you're trying to integrate with has a REST api available, then it should be pretty simple to use it with Midio.
Lets make an integration with (which requires no API key) as a simple example.
If the service you're integrating with requires an API key, check out the .
You can make a request to this api by adding an Http Fetch
node, and pasting the base url into the url input like we do above.
The various API endpoints can be reached by modifying the url, but lets make some nodes that wrap the API in a nicer way.
First, lets convert this node into a reusable function; right click on the node, and select 'Convert to function'. Give it a name, like PokeAPI Base
.
This will give us a node without any inputs and output. Click it press the 'goto definition' button in the node toolbar, or 'g' on the keyboard.
Adding inputs and outputs is super simple. Simply start creating an arrow by clicking a socket on the Fetch
node, then control/cmd-click anywhere on the canvas to automatically create an input/output.
This function can now serve as a base for us to make custom functions for the various endpoints of PokeAPI.
As an example, here is a wrapper for the "pokemon" endpoint.
Which can then be used like so: