Using a data service

Updated at:

A data service allows you to manage your custom APIs and basic service APIs. You can view detailed information for each API. This topic describes the data service and how to use it.

Prerequisites

You have created and published a custom API. For more information, see Generate a Data API.

Procedure

  1. Sign in to the Data Analysis Console.
  2. In the top navigation bar, choose Data Assets and click Data Service.
  3. On the Data Service page, view information about your APIs.
    Table 1. Parameter descriptions
    Parameter Description
    ID The ID automatically generated by the system after you publish an API.
    Name The API name specified when you created the API. Click the name to view the API details.
    Type The API's interface type. Valid values:
    • custom API: An API created by a user. For more information, see Generate a Data API.
    • basic service API: A system-provided API used for basic service calls.
    Number of calls The number of times the API has been called.
    Creation time The time the API was published.
    Operations Click View to view the API's details.

    On the Data Service page, you can filter the APIs in the data service list by interface type or search by API name.

  4. Click an API name or View in the Operations column to open the Data Details page.
    Table 2. Parameter descriptions
    Parameter Description
    ApiSrn The API resource locator. Click Copy Invocation Address to invoke the API directly using the ApiSrn. For more information about how to invoke an API, see Java SDK Call Example and Python SDK Call Example.
    Basic information Basic information about the API.
    • ID: The ID automatically generated by the system after you publish the API.
    • Interface type: Can be a custom API or a basic service API.
    • Creation time: The time the API was published.
    HTTP interface information HTTP interface information for the API.
    • ApiSrn: The API resource locator.
    • Request method: The HTTP request method for the API. Only POST is supported.
    • Return type: The data type of the response message.
    Request parameters The request parameters for the API.
    Return parameters The return parameters for the API.
    Sample success response A sample response for a successful API call.
    Sample failure response A sample message returned when the API call fails. Use the error code definition to troubleshoot the issue.
    Error code definition A list of error codes and their descriptions.
  5. Click Test Service to test the API.
    On the Test Data Service page, enter the request parameters and click Start Test. After the test completes, the request log and response appear on the right side of the page. The response is a JSON array that contains values for fields such as avg_humidity and avg_temperature. A Test Succeeded status appears at the bottom of the page.