Skip to main content

Node - Send API Request


Function: It can get data from external systems through the API interface or push data to a specified interface address.

Use Case

  1. When a purchase request is approved, push the data in the current record to other systems.

  2. Regularly get data from the order management system and add the obtained data to the worksheet.

It supports two ways of data processing, push data and get data.

  • Send a custom request: That is, send requests to third-party systems to get or push data. It supports 6 methods of Get, Post, Put, Delete, Head and Patch.

  • Send a specified data object: That is, to push data from a worksheet to a third-party system.

I. Send a custom request

1.1 Get

Example: When course comments are collected publicly, you can obtain the user's IP address, and get the attribution of this IP from the relevant API service and write it into the corresponding field.

Documentation of API interface address: https://www.juhe.cn/docs/api/id/1

API URL

Paste the address of the API interface here. You can set a static or dynamic parameter value or a combination of them.

If it requires web proxy or SSL certificate verification when requesting, check it.

Administrators go to [Org Admin] > [Integration] > [Other] to configure the web proxy.

Headers

There are systems that require authorization information or other parameters, just configure in the [API URL] above.

Some systems require parameters to be configured in the Header.

As shown in the following interface example:

Configuration:

Token in the header is called authorization (i.e., authorization credentials), and you can enter your token value after it.

Trusted IP Address

Sometimes, some third-party platforms require trusted IPs to call APIs. The IPs used in the workflow of HAP to send requests are 123.59.59.220 and 106.75.14.110, with a random IP for each request.

Request Failure Settings

You can set the status code and error message when the request fails.

  • Write the status codes for successful requests together, separate them with English commas.

  • Set error codes and error messages separately.

Errors are displayed in the running history of the workflow.

Test API

After configuring the above, test the API.

If the parameters in the request URL use dynamic value of a node, in the first test, you will be asked to fill in the test data of the parameters, after filling in, you can replace the test value with the dynamic parameters and send the request. All fields are not required, you can leave them empty, and request with the null value. When clicking on the test API again, the parameters will be the last filled-in value.

  • The test supports request time, returning status code, and time taken for the request (in seconds);
  • The original returned parameters add [Response Body] naming, add [Response Header], and the content is the list of header returned by the API;
  • If the request method is HEAD and no body value is returned, the response body is not displayed;
  • When used by subsequent nodes, the dynamic value is displayed with Body and Header, and it is not displayed if there is no Body;

When a request times out or fails

The request times out if it takes more than 10 seconds. When the request times out or fails, the subsequent nodes can be processed in two ways:

  • Continue the process

    Continue the execution of the following nodes. If there is a following node that uses data or object in the current node, the corresponding item will be skipped ( for example, in the [Update Record] node, 5 fields are to be updated, and the update of 1 field involves the value in the current node, then only this field is skipped, and the other fields are updated normally).

  • Abort the process

    The process ends at this node and subsequent nodes are not executed.


Have questions about this article? Send us feedback