How it works
- Enter the address and choose the method; send a JSON, form or text body, and add query values or headers under the advanced options.
- For sign-in, pick bearer, basic, a header, a query value, or a key inside the address; the token lives in the vault and is only sent to the sites you allowed it for.
- The step returns the status, the body, the body read as JSON, and any values you name by path, such as data.items[0].id.
- An error status of 400 or above fails the step but still fills its outputs, so an error branch can read them; you can turn that off and check the status yourself.
- Redirects are followed a limited number of times, and sign-in headers are dropped if a redirect leads to a different site.
Routines that use it
Smart lights on arrival
When Back at the PC fires in the evening, HTTP request calls your light hub's API to turn the desk lamp on.
Weather in a banner
At a time at 07:30 fetches a weather API and Show banner displays the temperature it returned.
Log to a spreadsheet API
When Game stopped fires, POST the game's name and play time as JSON to your own logging endpoint.
Settings
| Setting | What it does |
|---|---|
| Url | The address to call, like https://api.example.com/items. |
| Method | GET reads. POST sends something new, PUT and PATCH change it, DELETE removes it, HEAD only asks for the headers. |
| Body type | What to send with the request. |
| Body | The body. For JSON, put values from earlier steps in with {{ x | json }} so quotes stay valid. |
| Form | Form fields, sent as name=value pairs like a web form. |
| Sign in | How to sign in. The token comes from the vault and is only sent to the sites it is allowed for. |
| Token | The secret to sign in with. |
| Username | The user name; the secret is the password. |
| Key name | The header or query name the token goes in. Empty: X-Api-Key for a header, api_key for a query value. |
| Queryadvanced | Values added to the address after ?, escaped for you. |
| Headersadvanced | Extra headers, like Accept: application/json. Put tokens under Sign in, not here. |
| Fail on error statusadvanced | Fail the step when the site answers with an error status (400 and up). Off: the step succeeds and Status says what came back. |
| Keepadvanced | Values to keep from a JSON answer: a name, and the path to it like data.items[0].id. Later steps read {{ steps.<this step>.values.<name> }}. |
Good to know
- Only http and https addresses; replies larger than 8 MB are refused.
- Cookies aren't kept between requests, so sites that need a browser login won't work this way.
Questions
- How do I keep my API key safe in a routine?
- Store it in the vault and choose it under Sign in instead of typing it into a header. The token is only filled in for the sites you allowed it for and is hidden in logs.
- Can I use part of the JSON reply in later steps?
- Yes. Name the values you want by path, like data.items[0].id, and later steps can read them from the step's outputs.
- Does a failed request stop the routine?
- By default an error status fails the step, but its status and body are still available to an error branch. Turn off 'fail on error status' to always continue and check the status yourself.