HTTPRequest – Overview
The HttpRequest action calls a web address, typically a REST API. This connects RUNOS with almost any service: send mails through Microsoft 365, read Gmail, create contacts in Odoo, fetch orders from a shop, upload invoices, read weather data, download files.
The response is available to the following actions, JSON responses already as an object:
{ "Type": "HttpRequest", "Name": "GetWeather", "Parameters": { "Url": "https://api.open-meteo.com/v1/forecast", "QueryParameters": { "latitude": "52.52", "longitude": "13.41", "current_weather": "true" } }}The temperature is then in {{GetWeather.Response.Body.current_weather.temperature}}, the status code in {{GetWeather.Response.StatusCode}}.
In the workflow editor you put a request together in the form and send it with Test step in the test view.
What the action can do
Section titled “What the action can do”| Task | How |
|---|---|
| Query data | Method: GET with QueryParameters |
| Send data | POST, PUT or PATCH with Body as JSON, form, text or XML |
| Upload files | BodyType: Multipart (form with files) or File (the file as the body) |
| Sign in | Connector with the name of a saved connector: API key, user and password, or OAuth2 (Microsoft, Google) with automatic token renewal |
| Several pages | AutoPagination follows the next-page links; Response.Items holds the entries of all pages |
| Many addresses | Urls, optionally with Parallel: true |
| Download files | DownloadPath |
| Robust on network problems | MaxRetries (default 2) retries after connection errors, timeouts and overload answers (429, 503 …); a POST is never sent twice once the server may have processed it |
| Accept other codes as success | SuccessStatusCodes, e.g. "200-299;404" |
The action fails when the server answers with an error code (4xx, 5xx), does not answer within TimeoutSeconds (default 100), or cannot be reached. The error contains the beginning of the server’s answer, which usually says what was wrong.
All parameters and the result are listed under Structure.
Signing in with connectors
Section titled “Signing in with connectors”Credentials don’t belong in the workflow JSON. Create a connector and give the action its name:
"Connector": "Odoo","Url": "/json/2/res.partner/search_read"The action then signs in the way the connector defines and appends a path such as /json/2/… to the connector’s base URL. For OAuth2 connectors (Microsoft 365, Gmail) RUNOS renews the token itself and repeats a request once if the server rejects the token.
| The service signs in with … | Connector |
|---|---|
| nothing (only the base URL) | None |
| API key | ApiKey |
| user and password | Basic |
| sign-in in the browser (Microsoft, Google) | OAuth2 |
Alternatively the action signs in with AuthType and AuthToken, and single connector values can be inserted with placeholders such as {{connector.Shop.ApiKey}}.
Examples
Section titled “Examples”- MS365: send mails through Microsoft 365, read contacts
- Gmail: fetch unread mails, mark them as read, send through Gmail
- Odoo Contacts: search and create contacts in Odoo
