Can I query external APIs?
Last updated
Was this helpful?
Last updated
Was this helpful?
Mechanic only has first-class API support for Shopify. However, you can use the action to fetch data from any source that's accessible with an HTTP URL. (APIs that require authentication via query param or header - basic auth, for example - are all supported. APIs that require authentication via OAuth are generally not supported.)
For this kind of work, we recommend an execution sequence that looks like this:
Use an HTTP action to fire a GET request for your data's URL.
Set up your task to respond to mechanic/actions/perform, so you can respond to the GET request's downloaded results.
If needed, query the external API again to get additional results (e.g. pagination, extended data).
If you expect to use the retrieved data frequently, or across several tasks, consider using the to store that data for easy re-use.