All Products
Search
Document Center

DataWorks:Use an API to provide data services

Last Updated:Jul 10, 2026

DataService Studio exposes processed data tables as REST APIs for other business applications. This tutorial walks you through creating, configuring, testing, and publishing an API that serves data from the ads_user_info_1d user profile table.

Prerequisites

Create a user profile API

After data synchronization and processing, the ads_user_info_1d table is ready. To expose it as an API, use the DataService Studio API feature to generate an API in Wizard Mode or Script Mode.

Step 1: Generate the user profile API

  1. Log on to the DataWorks console. In the target region, click Data Analysis and Service > DataService Studio in the left-side navigation pane. Select a workspace from the drop-down list and click Go to DataService Studio.

  2. Create an API service.

    On the DataService Studio page, click the image icon and choose Create API > Generate API. In the Generate API dialog box, select Wizard Mode to generate the API.

    Note

    DataService Studio supports two modes for generating APIs: wizard mode and script mode.

Step 2: Configure the user profile API

  1. Configure the API.

    In wizard mode, configure the following parameters to create an API for your MaxCompute data source. For more information, see Generate an API from a data source (API Gateway).

    Section

    Parameter

    Description

    Example

    Table

    Data Source Type

    Select the type of your data source.

    Note

    DataService Studio does not support Hive data sources. The available types are listed in the drop-down menu.

    This tutorial uses a MaxCompute data source.

    Data Source Name

    Select your data source.

    Select your business data source.

    Data Source Environment

    • Production Environment

    • Development Environment

    Select Production Environment.

    Data Table Name

    Select the table you want to expose through the API.

    Select the ads_user_info_1d table.

    Select Parameters

    Pagination for Return Results

    Controls whether results are paginated. This setting affects the request and response parameters.

    You can configure the maximum number of records per request in the service resource group settings. For more information, see Generate an API from a data source (API Gateway).

    Turn off Pagination for Return Results.

    Set as Req Param

    Set one or more fields in the table as request parameters.

    Set the dt partition field to Request Parameters.

    Set as Resp Param

    Select the table fields to include in the API response.

    Set all fields from the ads_user_info_1d table as Response Parameters.

    Sorting Fields

    Optional. To sort results, first select the desired fields in the parameter list.

    Do not sort.

  2. Configure the service resource group

    After you configure the API in wizard mode, click Resource Group for DataService Studio in the right-side navigation pane to configure the resource group. For more information, see Configure an API service resource group.

    Section

    Parameter

    Description

    Resource Group Type

    Scheme

    Exclusive Resource Group for DataService Studio.

    Exclusive Resource Group for DataService Studio

    You can select a serverless resource group (recommended) or an exclusive resource group for DataService Studio.

    Important
    • If you have purchased an exclusive resource group for DataService Studio, you can use it directly.

    • If you do not have a resource group, we recommend that you purchase a general-purpose serverless resource group. For more information, see Use a serverless resource group.

      If a newly purchased serverless resource group is grayed out and cannot be selected, you must first allocate a quota for the Data Services service to this resource group. For more information, see Allocate CU quotas to tasks.

    Environment Configuration

    Timeout

    Set the timeout to 30,000 ms.

    Maximum Number of Data Records for a Single Request

    Set the limit to 2,000.

Step 3: Test and publish the API

  1. Test the API to verify it returns the correct parameters. For more information, see Test an API.

    1. After you finish the configuration, click the image Save icon, and then click the image Test icon to open the API test page.

    2. In the API Test dialog box, enter values for the request parameters.

    3. Click Start Test to run the test.

  2. Publishing the API deploys it to API Gateway and generates a public endpoint. For more information, see API testing, publishing, and version management.

    1. After the API passes the test, return to the API editing page and click the image Submit icon. This creates a new API version. Click Version on the right panel to view its details.image

    2. Click Publish to publish the API service.

    3. After the API is published, you can manage the API by clicking Service Management in the Version panel, or by navigating to Service Management > API Management > Published APIs. For more information, see Manage and maintain APIs.

Next steps

After you publish the API, you can authorize applications to call the API. For more information, see Authorize an API and Call an API.