The REST API v2 Component is designed to interact with the most common APIs that are based on the HTTP protocol.
The component supports several authentication types. Depending on the selected type, different credential fields will be required.
This option does not require any specific fields and is used for APIs that do not require authentication or if you need to implement a custom mechanism, such as using the request body.
This is one of the simplest techniques for enforcing access controls to web resources. It uses two fields:
Each request will include an additional header field in the form of Authorization: Basic <credentials>
, where <credentials>
is the Base64 encoding of Username and Password joined by a single colon :
.
An API key is a secret unique identifier used to authenticate and authorize access to an API. It requires two fields:
Each request will include an additional header field formatted as <Header Name>: <Header Value>
.
OAuth2 is an authorization flow that allows third-party applications, such as this component, to access a user’s resources without sharing their credentials. It uses tokens to grant limited access to services, enabling secure delegated access across different platforms.
Before creating this type of credentials, you typically need to establish an integration in the external system—this could be a client/application or something similar. Often, you will also need to provide a redirect URI for this platform, which will look like https://{your-tenant-address}/callback/oauth2
.
After that, you will need to fill in the following fields in the component:
Add New Auth Client
:
After filling in all required information, press the Authenticate
button. A new window for the third-party system should open, where you need to log in and grant access.
If everything is successful, the component will automatically collect and refresh the access token, which will be added to the headers of each request in the form of Authorization: Bearer <access token>
.
GET
, POST
, PUT
, DELETE
, or PATCH
.Add Header
button, which is used to add custom headers to your request. Each header consists of two fields: the first is used as the header key, and the second is used as the header value.Method
is not GET
) has the following fields:
Content Type
, the component will generate the appropriate fields:multipart/form-data
or application/x-www-form-urlencoded
is selected, there will be an Add Part
button used to add parts to your request; each part consists of a key and a value.Retry by component
) - The component considers the following codes as errors that can be handled: 408
, 423
, 429
, everything greater than 500
, and ECONNABORTED
(timeout). You can select one of the available options:
Retry by component
- The component will attempt to retry this request.Use rebound functionality
- The component will send the incoming message back to the queue; after some time, this message will return (you can find more information about how rebounds work in the platform documentation).Don't retry (throw error)
- The component will throw an error directly.Emit error as message (don't throw errors)
- The component will send a message with the response received from the server.10
) - Set the maximum number of retry attempts. This option is only applicable when the Error Handling Policy
is set to Retry by component
.Error Codes for retry (string, optional) - A comma-separated list of codes or ranges. By default, the error handling policy applies when you receive HTTP codes 408, 423, 429, and any codes greater than 500. However, you can override these codes using this field.
401, 404, 503
.400-401, 405-410, 502-509
.403, 404, 500-599
.Note: You can only include codes above 299 here, and you cannot include 401 if OAuth2 authentication is selected.
application/octet-stream
, provide the URL to the file from internal or external storage directly in the "Body" field as a string.multipart/form-data
, specify any key as a string (e.g., file
) and the value as an object (switch the field to "JSONata Mode"), where one of the object keys should be url
, pointing to the file. Available parameters in this case:url
(string, required) - The link to the file from internal or external storage.filename
(string, optional) - The name of the file.knownLength
(number, optional) - The size of the file.5
) - Defines the maximum number of redirects to follow. If set to 0, no redirects will be followed.0
) - Delay the next request after the previous request by the specified milliseconds. The maximum delay is 1140000 (19 minutes), with a default of 0.100000
- 100 seconds) - The timeout period in milliseconds while the component waits for a server response. It should be a positive integer between 1
and 1,140,000
(19 minutes).Download as Attachment
is checked).unlimited
) - The maximum size of the HTTP request content in bytes.utf8
) - Indicates the encoding to use for decoding responses. In some cases, when you need to extract data from the message, you can use base64
here.None
If Download as Attachment
is checked:
Download as Attachment
is unchecked:Refer to the actions section HTTP Request (Axios Library).
To upload a file, ensure that you check the Upload File
option in the configuration. You will then have the following options:
application/octet-stream
application/octet-stream
.multipart/form-data
multipart/form-data
.Add Part
button.file
.JSONata mode
.url
—this will be the data source from which you need to retrieve the file.Integrator mode
, you can simply place your text or XML inside the body.You can switch to JSONata mode
if you need to utilize JSONata expressions.
JSONata mode
, you can simply place your JSON inside the body.