This document explains how to retrieve data from APIs published in Data Service in FineDataLink, where the request method is POST (application/JSON).
The published APIs are described as follows.
Request Description:
The FineDataLink server address used in the published API
Example: http://192.168.101.211:10636/webroot
If you need to customize the access path of the Web container, contact the technical support personnel to obtain the solution by sending an email to international@fanruan.com or clicking the icon in the lower right corner at https://help.fanruan.com/finedatalink-en/.
The address of the API published in Data Service
Example: http://192.168.101.211:10636/webroot/service/publish/72d0c1a3-06d3-41fe-b2b5-3dd323fc6654/Doc_489
An API URL is a sequential concatenation of Request domain name, App path prefix, App ID, and API path.
Example: service/publish
For details, see Binding an API to an Application.
The App ID to which the API is bound
Example: a970c48a-7d44-44ce-968c-be9ad12ea5b7
For details about how to obtain the request URL, see Function Description of Data Query API.
POST Request Body Parameters:
Pagination parameter
pageNum represents the number of pages, and you can set its value.
pageSize represents the number of data records per page, and you can set its value.
returnTotalNum returns the total number of data records
Custom parameter
If you set a custom parameter when publishing the API, but this parameter is not passed in the request, an error code will be returned.
Request Example:
{ "area": "North China", "pageNum": 1 "pageSize": 10, "returnTotalNum": true}
Returned Variable:
Returns success if the API call is successful.
Specific reasons for failure will be displayed in message. For details, see the "API Response Code Description" section.
Returns the number of data records on the current page.
It is related to the pageNum value. For example, there are 12 data records in total. The pageNum value passed in is 2, and the pageSize value is 10. The system will query the data from the second page, and the returned value of rowCount will be 2.
Response Example:
First, select the desired API from the API list. Copy the path from the Authorized App section to obtain the complete API address, for example, http://192.168.101.211:10636/webroot/service/publish/72d0c1a3-06d3-41fe-b2b5-3dd323fc6654/Doc_489, as shown in the following figure.
If you have enabled authentication, you need to copy the AppCode on the App List tab page, as shown in the following figure.
Open the data fetching software. Select POST as the request method, and paste the copied API URL. Click Authorization and select API Key as the authorization type. Input Authorization as Key, paste the value copied in the "Obtaining API Authentication" section in Value, and set Add to Header, as shown in the following figure.
1. The copied address defaults to IP address:Port number/webroot. If you have configured direct access to FineDataLink through an IP address in Tomcat, you need to delete the /webroot part from the pasted URL.
2. The value of Value is a sequential concatenation of AppCode, space, and AppCode value. The AppCode in the following figure is an example.
Next, select raw and then JSON in the Body section and input the JSON data, as shown in the following figure.
The example retrieves data from North China, so the value of the custom parameter is set to North China. Set pageSize to 10 so that the data is limited to 10 entries per page. Data fetching will start from the first page, and all data will be fetched at once.
Click Send, and the response is displayed, as shown in the following figure.
For details about the API return value, see Data Service Error Code.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy