HTTP
Prev  Tools  Next

HTTP

The HTTP app provides various modules for communication based on Hypertext Transfer Protocol (HTTP). HTTP is the foundation of data communication for the World Wide Web. The modules enable you to download web pages and files, call webhooks and API endpoints, etc.

Getting Started with HTTP

The right choice of the module depends on the authentication/authorization mechanism the resource you wish to access employs:

  • Axelor Connect a request - universal module primarily intended for resources not employing any type of authentication/authorization

  • Axelor Connect a Basic Auth request - for resources employing HTTP Basic Authentication (BA)

  • Axelor Connect an OAuth 2.0 request - for resources employing OAuth 2.0 authorization protocol

  • Axelor Connect a Client Certificate Auth request - for resources employing an authorization protocol that requires a client-side certificate

  • Get a file - to download a file from the specified URL

  • Resolve a target URL - to retrieve a target URL from the chain of HTTP redirections

  • Retrieve headers - to return headers (name and value) from the specified HTTP request module in separate bundles.

[Caution] Caution

The module dialog fields that are displayed in bold (in the Axelor Connect scenario, not in this documentation article) are mandatory!

Axelor Connect a request

A universal module that enables you to configure an HTTP request and submit it to a server. The received HTTP response is then contained in the output bundle.

Evaluate all states as errors (except for 2xx and 3xx)

Use this option to set up error handling.

URL

Enter a URL you want to send a request to, e.g., API endpoint, website, etc.

Method

Select the HTTP method you want to use:

  • GET - to retrieve information for an entry.

  • POST - to create a new entry.

  • PUT - to update/replace an existing entry.

  • PATCH - to make a partial entry update.

  • DELETE - to delete an entry.

Headers

Enter the desired request headers. For example, an authorization.

[Caution] Caution

By default, the request does not contain the Accept header. If an unexpected response is returned, try adding the Accept: */* header.

HTTP_1.png

Query String

Enter the desired query key-value pairs.

Body type

HTTP Body is the data bytes transmitted in an HTTP transaction message immediately following the headers if there are any to be used.

Raw

The Raw body type is generally suitable for most HTTP body requests, even in situations where developer documentation does not specify data to send.

Specify a form of parsing the data in the Content type field.

HTTP_2.png

Despite the content type selected, data is entered in any format that is stipulated or required by the developer documentation.

Application/x-www-form-urlencoded

This body type is to POST data using application/x-www-form-urlencoded.

HTTP_3.png

For application/x-www-form-urlencoded, the body of the HTTP message sent to the server is essentially one query string. The keys and values are encoded in key-value pairs separated by & and with a = between the key and the value. Not suitable to use with binary data (use multipart/form-data instead).

Example of the resulting HTTP request format: field1=value1&field2=value2

Multipart/form-data

Multipart/form-data is an HTTP multipart request used to send files and data. It is commonly used to upload files to the server.

Add fields to be sent in the request. Each field must contain Key-Value pair.

Text

Enter the key and value to be sent within the request body.

File

Enter the key, and specify the source file you want to send in the request body. Map the file you want to upload from the previous module (e.g., HTTP > Get a File or Google Drive > Download a File), or enter the file name and file data manually.

Parse response

Enable this option to automatically parse responses and convert JSON and XML responses so you don't need to use JSON > Parse JSON or XML > Parse XML modules.

Before you can use parsed JSON or XML content, run the module once manually so that the module can recognize the response content and allow you to map it in subsequent modules.

HTTP_4.png

User name

Enter the user name if you want to send a request using the basic auth.

Password

Enter the password if you want to send a request using the basic auth.

Timeout

Specify the request timeout in seconds (1-300). Default: 40 seconds.

Share cookies with other HTTP modules

Enable this option to share cookies from the server with all HTTP modules in your scenario.

Self-signed certificate

Upload your certificate if you want to use TLS using your self-signed certificate.

Reject connections that use unverified (self-signed) certificates

Enable this option to reject connections that use unverified TLS certificates.

Follow redirect

Follows the URL redirections with 3xx responses.

Follow all redirect

Follows the URL redirections with all response codes.

Disable serialization of multiple same query string keys as arrays

By default, Axelor Connect handles multiple values for the same URL query string parameter key as arrays (e.g., www.test.com?foo=bar&foo=baz will be converted to www.test.com?foo[0]=bar&foo[1]=baz). To disable this feature, activate this option.

Request compressed content

Enable this option to request a compressed version of the website.

Adds an Accept-Encoding  header to request compressed content.

Example

Shows how to set up the module to submit a POST request with JSON payload:

HTTP_5.png

To make sure your JSON is valid, you may use one of the available online services (e.g., https://jsonlint.com/) or employ the JSON > Create JSON module to create the JSON dynamically and take care of all the necessary escaping. Mixing JSON pieces with expressions and items directly in the Request content field is not recommended, as it can result in an invalid JSON.

HTTP_6.png
Axelor Connect a Basic Auth request

A module that enables you to configure an HTTP request with HTTP Basic authentication and submit it to a server. The received HTTP response is then contained in the output bundle.

Credentials

Click Add to add your credentials (user name and password) for basic authentication.

[Note] Note

You can add more credentials to switch between each connection easily.

Evaluate all states as errors (except for 2xx and 3xx )

Use this option to set up error handling.

URL

Enter a URL you want to send a request to, e.g., API endpoint, website, etc.

Method

Select the HTTP method you want to use:

  • GET to retrieve information for an entry.

  • POST to create a new entry.

  • PUT to update/replace an existing entry.

  • PATCH to make a partial entry update.

  • DELETE to delete an entry.

Headers

Enter the desired request headers. For example, authorization.

By default, the request does not contain the Accept header. If an unexpected response is returned, try adding the Accept: */* header.

HTTP_1.png

Query String

Enter the desired query key-value pairs.

Body type

HTTP Body is the data bytes transmitted in an HTTP transaction message immediately following the headers if there are any to be used.

Raw

The Raw body type is generally suitable for most HTTP body requests, even in situations where developer documentation does not specify the data to send.

Application/x-www-form-urlencoded

This body type is to POST data using application/x-www-form-urlencoded.

HTTP_3.png

For application/x-www-form-urlencoded, the body of the HTTP message sent to the server is essentially one query string. The keys and values are encoded in key-value pairs separated by & and with a = between the key and the value. Not suitable to use with binary data (use multipart/form-data instead).

Example of the resulting HTTP request format: field1=value1&field2=value2

Multipart/form-data

Multipart/form-data is an HTTP multipart request used to send files and data. It is commonly used to upload files to the server.

HTTP_7.png

Add fields to be sent in the request. Each field must contain Key-Value pair.

Text

Enter the key and value to be sent within the request body.

File

Enter the key and specify the source file you want to send in the request body.

Map the file you want to upload from the previous module (e.g., HTTP >; Get a File or Google Drive > Download a File), or enter the file name and file data manually.

Parse response

Enable this option to parse responses and convert JSON and XML responses automatically so you don't need to use JSON > Parse JSON or XML > Parse XML modules.

Before you can use parsed JSON or XML content, run the module once manually so that the module can recognize the response content and allow you to map it in subsequent modules.

HTTP_4.png

Timeout

Specify the request timeout in seconds (1-300). Default: 40 seconds.

Share cookies with other HTTP modules

Enable this option to share cookies from the server with all HTTP modules in your scenario.

Self-signed certificate

Upload your certificate if you want to use TLS using your self-signed certificate.

Reject connections that are using unverified (self-signed) certificates

Enable this option to reject connections that are using unverified TLS certificates.

Follow redirect

Follows the URL redirections with 3xx responses.

Follow all redirect

Follows the URL redirections with all response codes.

Disable serialization of multiple same query string keys as arrays

Disable serialization of multiple same query string keys as arrays (e.g., www.test.com?foo=bar&foo=baz will be converted to www.test.com?foo[0]=bar&foo[1]=baz ). To disable this feature, activate this option.

Request compressed content

Enable this option to request a compressed version of the website.

Adds an Accept-Encoding header to request compressed content.

Axelor Connect an OAuth 2.0 request

In order to make HTTP(S) requests that require an OAuth 2.0 authorization, you need to create an OAuth connection first.

Create an OAuth 2.0 Connection
  1. Create an OAuth client in the target service you want to communicate with Axelor Connect. This option is most likely to be found in the Developer section of the given service. When creating the client, you will be asked to specify a so-called Redirect URL (sometimes called a Callback URL).

    1. Use the following Redirect URL: https://www.integromat.com/oauth/cb/oauth2https://auth.redirect.celonis.cloud/oauth/cb/oauth2.

      [Note] OAuth redirect URI domain

      Notice that the redirect URI starts with https://www.integromat.com instead of https://www.make.com. This is currently a known issue in Axelor Connect.

      Axelor Connect was formerly called Integromat, which means you can trust this URL as much as any Axelor Connect URL.

      Please make sure all your OAuth redirect URIs point to https://www.integromat.com/oauth/cb/oauth2.

    2. Once you have created the client in the 3rd party service, the given service will display two keys:

      1. Client ID

      2. Client Secret

        [Note] Note

        Some services call these App Key and App Secret.

    3. Axelor Connect sure you save these keys. You will be asked to provide them when creating the connection in Axelor Connect.

  2. Find the Authorize URI and Token URI in the API documentation of the given service (if the service uses implicit flow, you will need only Authorize URI). These are URL addresses through which Axelor Connect communicates with the target service. The addresses serve for OAuth authorization.

    1. Examples of Yahoo addresses:

      1. Authorize URI: https://api.login.yahoo.com/oauth2/request_auth

      2. Token URI: https://api.login.yahoo.com/oauth2/get_token

  3. If the service uses scopes (access rights), check how the service separates individual scopes, and make sure you set the Scope separator in the connection advanced settings (see below).

  4. Once you have completed the steps above, you can proceed with setting up the module:

Connection

Click the Add button to create an OAuth 2.0 connection.

Connection name

Enter the name of the connection.

Flow type

Select the flow for obtaining tokens.

Authorization Code

Enter Authorize URI and Token URI you have retrieved from the service's API documentation.

Implicit

Enter Authorize URI you have retrieved from the service's API documentation.

Scope

Add the API scopes for your connection. Check the service API documentation for the list of API scopes.

Scope separator

Select the separator for the list of scopes you entered above. Check the service API documentation for the format of the list of scopes.

If the separator is not set correctly, Axelor Connect will be unable to create the connection, and you will receive an invalid scope error.

Client ID

Enter the Client ID. You get the Client ID when you create an OAuth client in the service.

Client Secret

Enter the Client Secret. You get the Client Secret when you create an OAuth client in the service.

Authorize parameters

Enter the additional authorization request parameters as a key-value pair.

Standard parameters:

  • response_type: code for Authorization Code flow and token for Implicit flow

  • redirect_uri:

    https://www.integromat.com/oauth/cb/oauth2

  • redirect_uri:

    https://auth.redirect.celonis.cloud/oauth/cb/oauth2

  • client_id: The Client ID you entered when creating the account

Access token parameters

Enter additional access token request parameters as key-value pairs.

Standard parameters:

  • grant_type: authorization_code

  • redirect_uri: https://www.integromat.com/oauth/cb/oauth2

  • redirect_uri:

    https://auth.redirect.celonis.cloud/oauth/cb/oauth2

  • client_id: The Client ID you entered when creating an account.

  • client_secret: The Client Secret you entered when creating the account.

  • code: The code returned by the authorization request.

Refresh token parameters

Enter the additional refresh token request parameters as a key-value pair.

Standard parameters:

  • grant_type: refresh_token

  • refresh_token: The Refresh token obtained together with the Access token

  • client_id: The Client ID you entered when creating the account

  • client_secret: The Client Secret you entered when creating the account

Custom Headers

Specify any custom headers to send in the request.

Token placement

Select whether to send the token in the header, query string, or both.

Header token name

Enter the name of the authorization token in the header. Default: Bearer.

Query string parameter name

Enter the name of the authorization token in the query string. Default: access_token.

Evaluate all states as errors (except for 2xx and 3xx )

Use this option to set up error handling.

URL

Enter a URL you want to send the request to, e.g., API endpoint, website, etc.

Method

Select the HTTP method you want to use:

  • GET - to retrieve information for an entry.

  • POST - to create a new entry.

  • PUT - to update/replace an existing entry.

  • PATCH - to make a partial entry update.

  • DELETE - to delete an entry.

Headers

Enter the desired request headers. For example, an authorization.

By default, the request does not contain the Accept header. If an unexpected response is returned, try adding the Accept: */* header.

HTTP_1.png

Query String

Enter the desired query key-value pairs.

Body type

HTTP Body is the data bytes transmitted in an HTTP transaction message immediately following the headers if there are any to be used.

Raw

The Raw body type is generally suitable for most HTTP body requests, even in situations where developer documentation does not specify data to send.

Specify a form of parsing the data in the Content type field.

HTTP_2.png

Despite the content type selected, data is entered in any format that is stipulated or required by the developer documentation.

Application/x-www-form-urlencoded

This body type is to POST data using application/x-www-form-urlencoded.

HTTP_3.png

For application/x-www-form-urlencoded, the body of the HTTP message sent to the server is essentially one query string. The keys and values are encoded in key-value pairs separated by & and with a = between the key and the value. Not suitable to use with binary data (use multipart/form-data instead).

Example of the resulting HTTP request format:

field1=value1&field2=value2

Multipart/form-data

Multipart/form-data is an HTTP multipart request used to send files and data. It is commonly used to upload files to the server.

HTTP_7.png

Add fields to be sent in the request. Each field must contain Key-Value pair.

Text

Enter the key and value to be sent within the request body.

File

Enter the key and specify the source file you want to send in the request body.

Map the file you want to upload from the previous module (e.g., HTTP > Get a File or Google Drive > Download a File), or enter the file name and file data manually.

Parse response

Enable this option to parse responses and convert JSON and XML responses automatically so you don't need to use JSON > Parse JSON or XML > Parse XML modules.

Before you can use parsed JSON or XML content, run the module once manually so that the module can recognize the response content and allow you to map it in subsequent modules.

HTTP_4.png

Timeout

Specify the request timeout in seconds (1-300). Default: 40 seconds.

Share cookies with other HTTP modules

Enable this option to share cookies from the server with all HTTP modules in your scenario.

Self-signed certificate

Upload your certificate if you want to use TLS using your self-signed certificate..

Reject connections that use unverified (self-signed) certificates

Enable this option to reject connections that use unverified TLS certificates.

Follow redirect

Follows the URL redirections with 3xx responses.

Follow all redirect

Follows the URL redirections with all response codes.

Disable serialization of multiple same query string keys as arrays

By default, Axelor Connect handles multiple values for the same URL query string parameter key as arrays (e.g., www.test.com?foo=bar&foo=bazwill be converted to www.test.com?foo[0]=bar&foo[1]=baz). To disable this feature, activate this option.

Request compressed content

Enable this option to request a compressed version of the website. Adds an Accept-Encoding header to request compressed content.

Axelor Connect a client certificate authentication request

Axelor Connects an HTTP(S) request to servers that require a client certificate authorization.

Credentials

Click the Add button to add your credentials (certificate) for client certificate authorization.

Provide the certificate you want to use for authorization.

Evaluate all states as errors (except for 2xx and 3xx )

Use this option to set up error handling.

URL

Enter a URL you want to send a request to, e.g., API endpoint, website, etc.

Method

Select the HTTP method you want to use:

  • GET - to retrieve information for an entry.

  • POST - to create a new entry.

  • PUT - to update/replace an existing entry.

  • PATCH - to make a partial entry update.

  • DELETE - to delete an entry.

Headers

Enter the desired request headers. For example, an authorization.

By default, the request does not contain the Accept header. If an unexpected response is returned, try adding the Accept: */* header.

HTTP_1.png

Query String

Enter the desired query key-value pairs.

Body type

HTTP Body is the data bytes transmitted in an HTTP transaction message immediately following the headers if there are any to be used.

Raw

The Raw body type is generally suitable for most HTTP body requests, even in situations where developer documentation does not specify data to send.

Specify a form of parsing the data in the Content type field.

HTTP_2.png

Despite the content type selected, data is entered in any format that is stipulated or required by the developer documentation.

Application/x-www-form-urlencoded

This body type is to POST data using application/x-www-form-urlencoded.

HTTP_3.png

For application/x-www-form-urlencoded, the body of the HTTP message sent to the server is essentially one query string. The keys and values are encoded in key-value pairs separated by & and with a = between the key and the value. Not suitable to use with binary data (use multipart/form-data instead).

Example of the resulting HTTP request format:

field1=value1&field2=value2

Multipart/form-data

Multipart/form-data is an HTTP multipart request used to send files and data. It is commonly used to upload files to the server.

HTTP_7.png

Add fields to be sent in the request. Each field must contain Key-Value pair.

Text

Enter the key and value to be sent within the request body.

File

Enter the key and specify the source file you want to send in the request body.

Map the file you want to upload from the previous module (e.g., HTTP > Get a File or Google Drive > Download a File), or enter the file name and file data manually.

Parse response

Enable this option to automatically parse responses and convert JSON and XML responses so you don't need to use JSON > Parse JSON or XML > Parse XML modules.

Before you can use parsed JSON or XML content, run the module once manually so that the module can recognize the response content and allow you to map it in subsequent modules.

HTTP_4.png

Timeout

Specify the request timeout in seconds (1-300). Default: 40 seconds.

Share cookies with other HTTP modules

Enable this option to share cookies from the server with all HTTP modules in your scenario.

Self-signed certificate

Upload your certificate if you want to use TLS using your self-signed certificate.

Reject connections that are using unverified (self-signed) certificates

Enable this option to reject connections that are using unverified TLS certificates.

Follow redirect

Follows the URL redirections with 3xx responses.

Follow all redirect

Follows the URL redirections with all response codes.

Disable serialization of multiple same query string keys as arrays

By default, Axelor Connect handles multiple values for the same URL query string parameter key as arrays (e.g., www.test.com?foo=bar&foo=baz will be converted to www.test.com?foo[0]=bar&foo[1]=baz). To disable this feature, activate this option.

Request compressed content

Enable this option to request a compressed version of the website. Adds an Accept-Encoding header to request compressed content.

Get a file

Downloads a file from a URL.

URL

Enter the URL of the file you want to download. You can use the file (map the file data) in other modules in the scenario.

Resolve a target URL

Enter the URL you want to resolve. The output bundle contains the link to which the original URL redirects in the location response header.

URL

Enter the URL you want to resolve.

Method

Select the method you want to use.

Retrieve Headers

Returns each header (name and value) from the specified HTTP module in a separate bundle.

Source Module

Select the module you want to retrieve headers from.

Generating JSON Web Tokens (JWT)

You can generate JWT tokens using the HS256 algorithm with built-in functions:

Header:

mceclip0-14.png

Code for copy & paste:

{{replace(replace(replace(base64("{""alg"":""HS256"",""typ"":""JWT""}"); "/=/g"; emptystring); "/\+/g"; "-"); "/\//g"; "_")}}

Payload:

mceclip1-6.png

Code for copy & paste:

{{replace(replace(replace(base64("{""iss"":""key"",""exp"":" + (timestamp + 60) + "}"); "/=/g"; emptystring); "/\+/g"; "-"); "/\//g"; "_")}}

Token:

mceclip2-12.png

Code for copy & paste:

{{11.header}}.{{12.payload}}.{{replace(replace(replace(sha256(11.header + "." + 12.payload; "base64"; 16.secret); "/=/g"; emptystring); "/\+/g"; "-"); "/\//g"; "_")}}
Previous Next
Copyright © 2005-2024 Axelor. All Rights Reserved. White label documentation
  • Getting Started with HTTP
    • Axelor Connect a request
      • Example
    • Axelor Connect a Basic Auth request
    • Axelor Connect an OAuth 2.0 request
      • Create an OAuth 2.0 Connection
    • Axelor Connect a client certificate authentication request
    • Get a file
    • Resolve a target URL
    • Retrieve Headers
  • Generating JSON Web Tokens (JWT)

Prev  Up  Next
Tools  Home  XML