Publishing APIs That Support Multi-value Queries

  • Last update: July 03, 2025
  • iconNote:
    This document applies to FineDataLink of V4.2.6.2 and later versions.

    Application Scenario

    You want to publish an API that enables multi-value filtering on specific table columns, which can be implemented by passing multiple values through a single parameter via the SQL IN() clause.

    1.2.jpg

    Procedure

    This document uses the SORDER table as an example to illustrate how to publish the table data as an API that enables fetching data of multiple regions (such as North China, East China, and South China) simultaneously.

    Creating an API

    Click Data Service, choose New > API Service, enter the name of the API service, and click OK, as shown in the following figure.

    2.1.png

    Configuring API Information

    Service Content (Data Query)

    The following figure shows the setting page.

    SELECT * FROM `demotest`.`SORDER` where OWNER_REGION IN ($Area)

    2.2.1.jpg

    The following table describes the setting items.

    For details about each setting item, see Overview of API Release.

    Setting ItemDescription

    SQL Statement

    Enter the SQL statement. This example uses MySQL syntax. Adjust the statements accordingly if you use other databases.

    Pagination Query

    Disable Pagination Query. The API to be generated will return data without pagination after being called.

    Custom Parameter

    Use East China and North China as debug values of the custom parameter Area, which can be used to preview query results. (Data whose OWNER_REGION value is East China or North China will be returned).

    API Configuration

    1. Select POST as Request Method and set the path to Doc_489. Custom path is supported.

    Add an App. If no App has been created, you can skip this step and bind the API to an App in App List after completing the API creation. For details, see Binding an API to an Application. The binding step is mandatory; otherwise, the API cannot be called later.

    Set Request Body Format to application/json, as shown in the following figure.

    For details about each setting item, see Overview of API Release.

    2.2.2-1.jpg

    2. Click Test Call in the lower right corner to debug the API. The parameter value of Area defaults to the debug values East China and North China, as shown in the following figure.

    2.2.2-2.png

    3. Click Save and Activate. The API is created and activated successfully, as shown in the following figure.

    2.2.2-3.png

    Subsequent Operations

    If you do not bind the API to a specified App when publishing the API, you can still manage the published API by binding it to an App in App List to ensure that the API can be called.

    For details about using published APIs, see Using APIs Released in Data Service (POST application/json Request). The following figure shows the call effect.

    3.jpg

    For details about managing published APIs, see Data Service O&M.

    附件列表


    主题: 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