Call API
The call API task enables you to call an external API and parse the output. This can be used for instance to run external tests, or trigger other system to run other tasks. The following options are available:
Note: The following variables can be used in the request URL / body, and the response URL / body:
%%REVISION_ID%% - The ID of the revision used for this release.
%%BRANCH_NAME%% - The name of the branch used for this release.
%%MX_APP_ID%% - The Mendix App ID of the app used for this release.
%%ENVIRONMENT_ID%% - The environment ID of the environment used for this release.
%%APP_URL%% - The URL of the environment used for this release.
API call type: Synchronous or Asynchronous. When 'Synchronous' is selected the API will be called and the response will be parsed directly to determine if it was successful. When 'Asynchronous' is selected, a second API will be polled to determine if the call was successful or is still being processed.
Use Authentication. If selected, the call will use authentication.
Authentication: The authentication method to use for authentication.
Username: The username to use for authentication.
Password: The password to use for authentication.
Use custom HTTP headers: If selected, the call will use the custom HTTP headers that you configure. For each custom header you can specify the following:
Name. The name of the HTTP header.
Value: The value of the HTTP header.
Request operation: Select the HTTP operation used by the API: GET or POST.
Request URL: Enter the full URL used for the API request. The variables listed above can be used in the URL.
Request body: For POST type requests, the HTTP body to be sent. The variables listed above can be used in the body.
Response operation: Select the HTTP operation to be used for the response by the API: GET or POST. This option is only used when you have selected 'Asynchronous' for the API call type.
Response URL: Enter the full URL used for the API response. The variables listed above can be used in the URL. This option is only used when you have selected 'Asynchronous' for the API call type. This is the URL that will be called to check the response of the initial API request.
Response body: For POST type requests, the HTTP body to be sent. The variables listed above can be used in the body. This option is only used when you have selected 'Asynchronous' for the API call type. This is the body that will be sent to the API to check the status of the initial API request.
Timeout (s): The timeout (in seconds) to be used for all API calls.
Success check: The Regex to be used to determine if the API call succeeded. This is used for both synchronous and asynchronous API calls and will be used to parse the response from the API request. Use a regex that is supported by the Mendix isMatch() string function. For synchronous calls, if you leave this empty the call will be successful if an HTTP 2XX status code is returned.
Processing check: The Regex to be used to determine if the API call is still being processed. This is used only for asynchronous API calls and will be used to parse the response from the API (as returned from the Response URL configured above). Use a regex that is supported by the Mendix isMatch() string function.
Last updated