English
English
简体中文
Contact Us
Register
Log In
layoutIndex

API Management

Last Updated on : 2021-07-13 03:22:18download

This topic describes how to manage APIs.

API management

  1. Log in to the Tuya IoT Platform.

  2. In the left-side navigation bar, click Data > Data Analysis > Project Manage, select a project, and click Enter Project.

  3. In Data Source Management, click Data Services > API Management.API Management

    The headers in the table are described as follows:

    Header Description
    API Identifier The unique identifier automatically generated after an API is created.
    Type The panel API and application API are available currently.
    • Panel API: Used for data visualization in the panel.
    • Application API (coming soon): It can be called by a third party, but it only supports cloud-to-cloud connectivity.
    Description Description of the API.
    Creation On The time when an API is created.
    Creator The account that creates the API.
    Operation
    • Test: Test the API.
    • Edit: Edit the API.
    • Delete: Delete the API.
  4. (Optional) Click the API identifier to view the parameters: request parameters, response parameters, and field sorting of the API. Do not modify the information here. You can edit it in the API list.
    API Management

  5. (Optional) Test: Test the API.

  6. (Optional) Edit: Edit the API.

  7. (Optional) Delete: Delete the API.

New API

You can encapsulate the stored data table into a data API that panels or applications can call.

Prerequisites

  • You have created at least one data table and the table has data.

Procedure

  1. On the page of API Management, click New API to create an API.

  2. Enter the API name, select an API type, enter the description, and select timeout time. Click Next.
    API Management

    Note:

    • Panel API: Used for data visualization in the panel.
    • Application API (coming soon): It can be called by a third party, but it only supports cloud-to-cloud connectivity.
  3. Configure API parameters.
    API Management
    API Management

Parameter Description
Select Data Source
  • Select Data Source: Three types of data tables are available: the real-time table, offline table, and time-series table. The time-series table is coming soon.
  • Select a data table: Select a data table for a specified data source.
Configure Request Parameter
  • Click + New Request Parameter to add a request parameter field.
  • Enter the Parameter Name, Bound Field, Parameter Type, Operator, Default Value, and Required. The Parameter Type is determined after a bound field is selected.
  • You can configure the rules of parameters through operators.
Response Parameter
  • Click + New Response Parameter to add a response parameter field.
  • Enter the Parameter Name, Bound Field, Parameter Type, and Default Value. The Parameter Type is determined after a bound field is selected.
Field Sorting
  • Click + New Field Sorting to add a field, and the API list is paginated according to the sorting rule.
  • Sort fields in groups based on the sorting field.
  • You can sort fields by drag-and-drop.
    Note: It is recommended that the added sorting field is the one for creating an index to speed up the query.