Authorization Mode

Last Updated on : 2024-10-23 06:45:24download

This topic describes how to use the GET:/v1.0/token API. The following two modes are available.

Simple mode

In simple mode, you can only access data from your SaaS projects. Each platform account corresponds to a single SaaS instance.

Authorization mode

In authorization mode, you can access SaaS data of other authorized users. When you call the API, two key parameters are required: code and associate_id.

Generate code and associate_id

To generate code and associate_id, perform the following steps:

  1. Contact the account manager to facilitate SaaS developer registration.

  2. Log in to the SaaS platform.

  3. In the project where API calls are required, select API Authorization from the left-side panel, and then click Authorization initialization.

    Authorization Mode

  4. Enter the cloud project code and click Add. After you select the desired API for authorization, click Save to complete the authorization process. Each project requires API authorization.

    Authorization Mode

View the cloud project code

  1. Log in to Tuya Developer Platform and click Open Project in the Operation column.

    Authorization Mode
  2. View the project code on the Overview page.

    Authorization Mode

View code and associate_id

  1. Select API Authorization from the left-side panel, and click Manage in the Operations column.

    Authorization Mode

  2. In the pop-up window, view authorization code and Associates ID of the developer account. These two values are important and will be used later.
    Authorization Mode

    • code: the authorization code in the preceding figure.
    • associate_id: the Associates ID in the preceding figure.