Help Center/ Customer Engagement Center/ API Reference/ Interface Authentication Modes/ C7 Lightweight Agent Workbench Page OAuth 2.0 Interface Authentication
Updated on 2025-11-13 GMT+08:00

C7 Lightweight Agent Workbench Page OAuth 2.0 Interface Authentication

Description

This interface is used to perform OAuth 2.0 authentication on the lightweight agent workbench page. When this interface is invoked, the request must contain the authorization code, refresh token, and client ID.

Interface Method

This interface supports only the POST method.

URI

https://Domain name/apiaccess/CC-Management/v1/oauth/token. (For example, the domain name is service.besclouds.com.)

Request

  • Message header
    Table 1 Parameter in the message header

    No.

    Parameter

    Type

    Mandatory

    Description

    1

    Content-Type

    String

    Yes

    Coding mode of the message body. The default value is application/json; charset=UTF-8.

  • Message body
    Table 2 Parameters in the message body

    No.

    Parameter

    Type

    Mandatory

    Description

    1

    grant_type

    String

    Yes

    Authorization type

    • authorization_code
    • refresh_token

    2

    client_id

    String

    Yes

    Client ID

    3

    client_secret

    String

    No

    Client secret

    This parameter is mandatory when grant_type is set to authorization_code.

    4

    code

    String

    No

    Authorization code

    This parameter is mandatory when grant_type is set to authorization_code.

    5

    redirect_uri

    String

    No

    URL of the third-party application to be accessed

    This parameter is mandatory when grant_type is set to authorization_code.

    6

    refresh_token

    String

    No

    Refresh token

    This parameter is mandatory when grant_type is set to refresh_token.

Response

Table 3 Parameters in the message body

No.

Parameter

Type

Mandatory

Description

1

result

Object

No

Result content object. For details about the parameters of this object, see Table 4.

2

returnCode

String

Yes

Error code. The options are as follows:

  • 0: success
  • Other values: failure

3

returnDesc

String

True

Response message.

Table 4 Parameters of result

No.

Parameter

Type

Mandatory

Description

1.1

access_token

String

Yes

Authentication token

1.2

token_type

String

Yes

Token type

The default value is Bearer.

1.3

expires_in

Integer

Yes

Token validity period, in seconds. The default value is 3600.

If the error code is not 0, no value is returned.

1.4

refresh_token

String

Yes

Refresh token

1.5

scope

String

Yes

Fixed read

Example

  • Message header
    Content-Type:application/json; charset=UTF-8
  • Request parameter
    {
        "grant_type": "authorization_code",
        "client_id": "A32135A8293289C5AFD5F9CAAD4CE9E5",
        "client_secret": "kt6D8aLI9ryfcisc",
        "code": "nJ8QI9",
        "redirect_uri": "https://www.baidu.com"
    }
  • Response parameter
    {
        "result": {
            "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBSUNDIiwic3ViIjoiMTcyNTYxMjY2ODk4NzEwOTE0NyIsInRlbmFudElkIjoiMjAyNDA4MDUwOTI1IiwiYXVkIjpbIkEzMjEzNUE4MjkzMjg5QzVBRkQ1RjlDQUFENENFOUU1Il0sImlhdCI6MTc0ODI0MzM5MSwiZXhwIjoxNzQ4MjQ2OTkxLCJqdGkiOiJlNjUyMzg1NS1mZmZkLTRhZTItOWE4NS01NWQwZDUwNTZlOTEifQ.Irw5TF_7LQIy9vCL7BmoZSqrWKkM5XDrZ897N0D8PMH2b3z3dHiKrzOB1H6O86ombADn4uWzrNL2715boDOVu4YRIIjqQHUVkmQH2_whT5xg00eIN4sDgfGkWM_x3FY5Ia_DqV24tZt6IowSUNUo3NMiq_426Af7rUaroHvuqJX-PqDg2LdpetPIYR3XR9WuMmkuybFk4zwcLH_dT3nN0LhPT1q3ABNXnxiSpFVGbDqyOLjQukIs4q0HGWhXQOdM6O5Bs6pzI3psATijBbhaQdQugqVfVZNPuRNRstaE6JJ9SCDeLGtGKrKCt0GAulIDs_cfUOyH47v_G2Gbi4y-iQ",
            "token_type": "Bearer",
            "expires_in": 3600,
            "refresh_token": "864ff2a5-02b0-4a7d-b085-84d76fc8ad8d",
            "scope": "read"
        },
        "returnCode": "0",
        "returnDesc": "success"
    }