Overview of API Release

  • Last update: October 30, 2024
  • Overview

    Version

    FineDataLink Version

    Functional Change

    4.0.20.1

    Allowed using MySQL, Oracle, PostgreSQL, SQLServer, and Greenplum databases (including parallel loading) to release APIs.

    4.1.8.2

    Allowed reading the ShenTong database in Data Service.

    4.1.11.5

    Displayed the database or schema of the chosen data table if you set Configuration Method to Table Selection.

    4.1.13.2

    Allowed selecting fields if you set Configuration Method as Table Selection.

    Application Scenario

    After you collect and process upstream data and store it in a specified database, you may hope to encapsulate the data into an API for the downstream system to call.

    Function Description

    FineDataLink allows you to release the processed database data in the form of an API, which can be used by other tools.

    Limitation

    iconNote:

    For details about the prerequisites and other restrictions of using Data Service, see Overview of Data Service.

    If the Doris or StarRocks database is used as the data source when you release an API, you need to use the ORDER BY statement to specify a valid sorting field. Otherwise, the pagination will not work properly, and the subsequent use of the API to fetch data will be affected.

    For example, use the SQL statement to sort the salary field.

    Procedure

    After creating an API, you need to complete the design in three steps: API Information, Release Content and Parameter, and Preview Test.

    API Information

    The basic information of the API (such as the request path, request format, and return format) is shown in the following table.

    Configuration Item

    Description

    Name

    Configure the name of the API.

    The API name cannot be duplicated.

    It is empty by default, the maximum length is 50 characters, and it is mandatory.

    Description

    Configure the description of the API.

    It is empty by default, the maximum length is 100 characters, and it is optional.

    Request Method

    Configure the request method. 

    GET and POST requests are supported currently.

    POST passes parameters through the body. GET passes parameters through the URL (Query Param).

    Descriptions for query parameters are as follows:

    • Parameter format: Query parameters are appended to the query string of the URL in the form of key-value pairs. Each key-value pair uses an equal sign (=) to link the name and value of the parameter. Different key-value pairs are separated by ampersands (&).

    • Parameter position: Query parameters appear after the question mark (?) in the URL and continue until the URL ends or a hash mark (#) is encountered. For example, http://Example.com/api?Param1=Value1&Param2=Value2#position.

    Request Body Format

    It is displayed when POST is selected as the request method.

    Select the following request body format (the request Content-Type):

    • application/json

    • application/x-www-form-urlencoded

    application/json is selected by default.

    Path

    Configure the API path to be released.

    The API paths cannot be duplicated.

    It is empty by default. English letters, numbers, underlines (_), hyphens (-), and forward slashes (/) are supported.

    For example, the following is a complete API request path:

    http://192.168.5.175:8089/webroot/service/publish/App ID/demo

    iconNote:

    1. The content before service is the current FineDataLink server address where the API is to be released.

    2. App ID is the ID of the application to which the API is bound. For details, see Binding API to Application.

    Timeout

    Fill in the response timeout. If the query result is not returned within the specified time, the API returns a timeout error.

    It is 10000 ms by default and it is mandatory.

    Authorized App

    You can add APIs to authorized applications during the creation stage and directly test API calls during the testing stage.

    API tasks can be added to multiple authorized applications in batches.

    For details, see Binding API to Application.

    iconNote:

    APIs must be bound to applications in order to be called.

    Release Content and Parameter

    Configuration Method

    You can select SQL or Table Selection as the configuration method.

    iconNote:

    In V4.1.3 and later versions, the Table Selection function is added, which allows you to directly select tables to synchronize data.

    1. SQL

    Query and fetch data from the source database tables through SQL statements. Referencing parameters is supported. For details about parameters, see Overview of Parameter.

    You can select the specified database, search for the required data table, and click the table to automatically enter the SQL statement into the SQL input box on the right, as shown in the following figure.

    2. Table Selection

    Setting Item

    Description

    Source Table

    Select the source table. It cannot be empty.

    If you set Configuration Method to Table Selection in V4.1.11.5 and later versions, the database or schema of the chosen table will be displayed.

    Partial Field Selection

    In V4.1.13.2 and later versions, partial field selection is supported.

    1. If all fields are selected during the field selection stage, the fields added to the table later will not be selected.

    2. Unselected table fields can be associated by the Data Filtering function.

    3. If you want to cancel the selection of selected fields, see the two solutions in the following figure.

    4. Only the selected fields are displayed in Returned Value Configuration.

    Table Description

    Displays the notes of the table.

    Databases that do not support this function:

    ClickHouse, Hive, Impala, TRANSWARP INCEPTOR, Informix, MaxCompute, SQLite, and StarRocks

    Data Filtering

    • The value can be empty.

    • Data in the source table can be filtered. The content is the WHERE conditional statement written in the syntax of the selected database (You do not need to fill in the WHERE keyword.).

    • Referencing various parameters is supported.

    • Linking parameter values and fields in the data table is supported.

    • LIMIT statements are not supported.

    Request Parameter Configuration

    Descriptions for request parameter configuration are as follows.

    Item

    Description

    Parameter Name

    Configure the name of the request parameter.

    Parameter names cannot be duplicated.

    It is empty by default and it is mandatory.

    Parameter Type

    Configure the type of the request parameter.

    • String

    • Number

    • Boolean

    iconNote:

    Date type parameters are marked as strings and passed in string format. Format example: [yyyy-MM-dd HH:mm:ss]

    Mandatory Parameter or Not

    Configure whether the current parameter is mandatory.

    If it is not enabled, the default value of the current parameter cannot be empty.

    Default Value

    It is used for non-empty check when the parameter is not mandatory.

    Configure the default value of the current parameter. If the parameter is not mandatory, the default value needs to be filled in.

    If the parameter is configured as not mandatory and no parameter is passed, the default value is used as the parameter value. The default value can be any value of the corresponding type (including NULL).

    iconNote:

    Whether the parameter is mandatory is for the actual API calls and parameter passing processes. During the previewing and testing stage, the parameter must still be filled in completely.

    Description

    Add a description for the parameter.

    The AppCode is empty by default.

    Returned Value Configuration

    iconNote:

    1. In V4.1.6.4 and later versions, Query Preview is updated to Returned Value Configuration.

    2. You can choose not to click Obtain, which will not affect the normal use of the API. However, if you do not obtain the returned values, the returned content of the API in the exported API document will be incomplete.

    If parameters are configured in the SQL statement:

    1. Parameters are automatically obtained in Request Parameter Configuration. Click Obtain in Returned Value Configuration to obtain the returned parameters.

    The obtained returned values are shown in the following figure.

    The details are as follows:

    • Modifying the field name or type is not supported. Adding descriptions to the field is supported.

    • Searching field names is supported.

    • Click Refresh and Preview to obtain the returned values again.

    If parameters are not configured in the SQL statement:

    The prompt "It is automatically obtained according to the query SQL." will appear in Request Parameter Configuration. Click Obtain in Returned Value Configuration to obtain the returned parameters.

    Preview Test

    Item List

    Description

    Test App

    Select the application to use when testing API calls.

    If no application is bound, this configuration item is grayed out and cannot be selected.

    Test Calling

    Enter the Body test value or Params test value to debug the API and test the call status.

    Binding the API to an Application

    APIs must be bound to applications in order to be called.

    You can bind the API to an application during the API Information stage or follow the steps in Binding API to Application after the Preview Test stage.

    Making the API Online

    API List displays all API information. Select the specified API to view the basic information, content, and parameters of the API.

    Click Online in the upper right corner to release the API, as shown in the following figure.

    附件列表


    主题: Data Service
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy