4.1
Optimized API return codes. Updated the return parameter totalCount to totalNum.
This document describes how to retrieve data from APIs published in Data Service in FineDataLink where Request Method is set to GET.
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 our technical support 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 API path set in the published API
Example: http://192.168.101.211:10636/webroot/service/publish/72d0c1a3-06d3-41fe-b2b5-3dd323fc6654/demo
You can directly copy the API path on the App List page.
The API URL : request domain name + App ID + API path
Example: http://192.168.101.211:10636/webroot/service/publish/
The App ID to which the API is bound
Example: 72d0c1a3-06d3-41fe-b2b5-3dd323fc6654
Custom path name. Example: demo.
GET
GET Query Params:
paging
pageNum
int
Yes
Pagination parameter
pageNum represents the number of pages, and you can set its value.
pageSize
pageSizerepresents the number of data records per page, and you can set its value.
params
object
No
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:
Parameters of the return parameter:
data
Returns the data fetched using the API.
totalNum
Returns the total number of fetched data records.
Returns the number of fetched data records per page.
Returns the page number, indicating the page from which the data fetching starts.
rowCount
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.
message
string
Returns success if the API call is successful.
Specific reasons for failure will be displayed in message. For details, see the section "API Response Code Description."
errCode
Error code. For details, see the section "API Response Code Description."
Response example:
{ "data": [ { "REQUIRED_DATE": "2012-06-02", "DATA_ID": "6315aef1ee89a400086fcfd0", "EMPLOYEE_ID": "20", "ORDER_DATE": "2012-06-05", "CUSTOMER_ID": "ERNSH", "OWNER_REGION": "North China", "PAID": "No", "SUBMITTER": "Peach", "OWNER_CITY": "Zhangjiakou", "UPDATE_TIME": "2022-09-05 16:10:26.000", "OWNER_COUNTRY": "China", "SHIPPER": "2", "OWNER_POSTAL_CODE": "801070", "OWNER_ADDRESS": "No.25, Jidong Road", "OWNER_PROVINCE": "Hebei (Province)", "SUBMISSION_TIME": "2022-09-05 16:10:26.000", "FREIGHT": "258.64", "ORDER_ID": "11072", "SHIPPED_DATE": null, "OWNER_NAME": "Mr. Wong" } ], "totalNum": 355, "errCode": 0, "pageSize": 1, "rowCount": 1, "message": "success", "pageNum": 1}
Select the API you need to use on the API List page and copy the path from the Authorized App to obtain the API URL. For example, http://192.168.101.211:10636/webroot/service/publish/72d0c1a3-06d3-41fe-b2b5-3dd323fc6654/demo, as shown in the following figure.
If you have enabled authentication, you need to copy the AppCode on the App List page, as shown in the following figure.
Open a data fetching software. Select GET as the request method, and input the copied API path. Click Authorization and select API Key as the authorization type. Input Authorization as Key, enter AppCode a970c48a-7d44-44ce-968c-be9ad12ea5b7 as Value, and set Add to to Headers, as shown in the following figure.
1. The copied path defaults to IP:port/webroot. If you have configured the direct access to FineDataLink through IP address in Tomcat, you need to delete the webroot part from the copied URL.
2. The parameter value is in the format of AppCode + space + APPCode value. The AppCode in the following figure is an example.
Click Params and input the parameters, as shown in the following figure.
In this example, when no parameters are specified, all data is fetched. Therefore, the area is not shown in the response. Set pageSize to 300 so that the data is limited to 300 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.
When using API-published data, you can determine whether the API response is successful based on the message field.
If message is success, the response is successful, as shown in the following figure.
If the API response fails, the system will return a status code for failure.
For details about API return value, see Data Service Error Code.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy