Home / API Documentation / Before you start / Authentication

Authentication

The platform supports using tokens to authenticate users accessing the platform.

Tokens issued by the system carry information about the user’s identity and permissions. When a user calls an API provided by the platform, the token is added to the request message header, allowing for authentication and obtaining permissions to access platform resources.

The specific format for the token in the request header is as follows:

KEY Value
Authorization Bearer {Your Token}

Note: {Your Token} is the token obtained through the platform, and the input format for the token in the request header is as follows: Bearer eyJhxxxxxxxxxxxxxxxUiOiJhZG1pbiIsImV4dQ.

The following example shows how to use the token when calling an interface through the command line.

## List services
curl -X "GET" "https://{IP Address or Domain Name}/auth/v1/users?limit=20" \
     -H "Authorization: Bearer <your token>"

Obtain a Token

All the APIs we provide to the public require authentication and authorization using a token. Therefore, before using our APIs, you need to obtain a valid token.

In the personal center of the platform, you can add and manage your tokens as needed. Each token carries your identity and permission information on the platform.

Caution: To prevent others from using your token to perform unauthorized operations on the platform, please do not share your token casually.

Prerequisites

Before obtaining a token, you need to have an account that can log in to the platform normally. If you do not have an account on the platform yet, you can contact the platform administrator to apply for an account.

Procedure

  1. After successfully logging in to the platform, click Account Name > Profile in the upper right corner of the interface.

  2. On the API Token tab, click Add Token.

  3. Enter a description for the token and set the validity period.

  4. Click Add.

  5. Click Copy and save your token.

    Caution: Please make sure you have copied the token before closing the API token created dialog box.
    After the token is successfully added, you need to save the token information yourself. The token information can only be viewed in the API token created dialog box, and the dialog box cannot be reopened after it is closed.