Overview
Version
FineDataLink Version | Functional Change |
---|---|
4.1.1 |
|
4.1.3 | Supported multiple rows of data from the preceding node if the request body format in the API Output operator was raw. (In previous versions, this operator supported one row of data from the preceding node only.) |
Application Scenario
You need to use FineDataLink to achieve data interaction among business systems via APIs.
For example, after fetching data from the system and analyzing it, you want to push the analysis result to the business system via an API for direct processing in the business system, thus streamlining the process from data analysis to data application.
Function Description
FineDataLink provides an API Output operator, by which you can achieve application integration via APIs.
Restriction on Use
1. Request methods supported by API Output include POST, PUT, PATCH, and DELETE.
2. If the request body format in the API Output operator is raw, this operator supports multiple rows of data from the preceding node. For details, see API Output Example.
3. If the preceding node of API Output outputs multiple rows of data, FineDataLink outputs one row of data to the API per call, where the total number of API calls equals the number of data rows in the preceding node.
Procedure
Preparing Data
1. Before outputting data to an API, you need to know the content required to call the API.
2. Prepare the content required to call the API, such as the Header parameter and the body content. You can use the JSON Generation operator to output data to be written as the parameter in a body format required by the API.
Writing Data into an API
The configuration page of the API Output operator is shown in the following figure.
Request Method
The supported request methods include POST, PUT, PATCH, and DELETE.
Headers and Body
1. The Content-Type parameter is added by default, and you can set its value to application/x-www-form-urlencoded, application/json, application/xml, multipart/form-data, text/xml, or text/plain.
2. The linkage between settings in Body and the Content-Type value is described in the following table.
Body Format | Type | Default Value of Content-Type | Description |
---|---|---|---|
form-data | / | multipart/form-data | You can add multiple rows with one field per row. The key name is the field name, and the key value is the field value. |
x-www-form-urlencoded | / | application/x-www-form-urlencoded | You can add multiple rows with one field per row. The key name is the field name, and the key value is the field value. |
raw | JSON | application/json | You can select a single field. |
XML | application/xml | You can select a single field. | |
TEXT | text/plain | You can select a single field. |
3. You can enter a content type not in the drop-down list of Parameter Value in Headers, as shown in the following figure.
If the entered Content-Type value is beyond the linkage range, the settings in Body remain unchanged until the Content-Type value is changed.
If you enter a Content-Type value with no corresponding Body format/type and then modify the settings in Body, the Content-Type value in Headers will be overwritten with the type in Body.
1. If you have prepared a self-signed certificate, enable TLS/SSL Certificate, upload the certificate, and enter the password.
2. You can disable SSL certificate verification to bypass certificate verification. For details, see the "Others" part of this section.
Return Value Processing
Set Return Value as Parameter is a checkbox (deselected by default). If it is selected, the value returned by the API will be output as a parameter. You can set the parameter name and the default value to help judge the API call status.
Its default value, similar to the one in the Parameter Assignment node, is used to facilitate effect previewing at the succeeding node. The actual parameter value is the value returned by the API.
The value returned by the API per call will be summarized as the parameter value if the body format in the API Output operator is raw, the preceding node outputs multiple rows of data, and Set Return Value as Parameter is selected. (The number of API calls equals the number of data rows in the preceding node).
The following is an example of the parameter value when the API is called twice.
{"code":200,"detail":"success","ok":{"code":200,"message":"success","self":"http://project.fanruan.com:6023/dataway/service/rest/api/2/issue/804566"},"data":[]},
{"code":200,"detail":"success","ok":{"code":200,"message":"success","self":"http://project.fanruan.com:6023/dataway/service/rest/api/2/issue/804566"},"data":[]}
Call Frequency Control
You can limit the number of calls of the current API in a single execution instance by configuring Call Frequency Control, where you can control the frequency at the second/minute/hour/day level.
The call will wait if the number of API calls exceeds the set limit. For example, if you set Call Frequency Control to Every Minute Execute 3 Time(s), and the API will be called six times in one instance, the API will be called three times in the first minute and three more times in the second minute.
Disabling SSL Certificate Verification
You can disable SSL certificate verification when outputting data to an API.
You can disable SSL certificate verification for the HTTPS-enabled API by adding an SSL-certificate-verification parameter under API Output > Headers and setting the parameter value to false. In this way, FineDataLink performs no certificate verification when calling the API. (Certificate verification is necessary only for HTTPS-enabled target APIs.)
