Updated on 2023-12-22 GMT+08:00

Updating a Token

Description

This API is used to update the validity period of a token.

Debugging

You can debug this API in API Explorer.

Prototype

Table 1 Prototype

Request Method

PUT

Request Address

/v1/usg/acs/token

Transport Protocol

HTTPS

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Location

Description

X-Access-Token

Yes

String

Header

Access token.

X-Request-ID

No

String

Header

Request ID, which is used for fault tracing and locating. You are advised to use a UUID. If this parameter is not carried, a request ID is automatically generated.

Accept-Language

No

String

Header

Language. Values: zh-CN for Chinese (default) and en-US for English.

Status Codes

Table 3 Status codes

HTTP Status Code

Description

200

Operation successful.

400

Invalid parameters.

401

Authentication is not performed or fails.

403

Insufficient permissions.

500

Server exception.

Response Parameters

Table 4 Response parameters

Parameter

Type

Description

accessToken

String

Access token.

clientType

Integer

Type of the account used for login.

  • 72: API calling.

createTime

Long

Timestamp when the token is created, in milliseconds.

daysPwdAvailable

Integer

Password validity period.

delayDelete

Boolean

Whether the token deletion is delayed.

expireTime

Long

Timestamp when the token expires, in seconds.

firstLogin

Boolean

Whether the login is the first login.

NOTE:

If you log in to the system for the first time, the system prompts you to change the initial password.

Default value: false.

forceLoginInd

Integer

Whether preemptive login is enabled.

  • 0: disabled.
  • 1: enabled. (This value is not provided.)

proxyToken

ProxyTokenDTO object

Proxy authentication information.

pwdExpired

Boolean

Whether the password has expired.

Default value: false.

refreshCreateTime

Long

Timestamp when a refresh token is created, in milliseconds.

refreshExpireTime

Long

Timestamp when the refresh token expires, in seconds.

refreshToken

String

Refresh token.

refreshValidPeriod

Long

Validity period of the refresh token, in seconds.

tokenIp

String

IP address of the user.

tokenType

Integer

Token type.

  • 0: user access token.
  • 1: meeting control token.
  • 2: one-off token.

user

UserInfo object

User authentication details.

validPeriod

Long

Validity period of the token, in seconds.

Example Request

PUT /v1/usg/acs/token
Connection: keep-alive
X-Access-Token: stbo3vX1pyduWpSFsjMCmR93mJkfQGnohjvQ
Content-Type: application/json
Content-Length: 88
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)

Example Response

HTTP/1.1 200 
Date: Wed, 18 Dec 2019 06:20:40 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 714
Connection: keep-alive
X-Request-Id: f90fbd8714328398fcbedddde0f1303c

{
    "accessToken": "stbo3vX1pyduWpSFsjMCmR93mJkfQGnohjvQ",
    "clientType": 72,
    "createTime": 1599102826754,
    "daysPwdAvailable": -18172,
    "delayDelete": false,
    "expireTime": 1577979513,
    "firstLogin": true,
    "forceLoginInd": null,
    "proxyToken": null,
    "pwdExpired": false,
    "refreshCreateTime": 1599102826754,
    "refreshExpireTime": 1601694826,
    "refreshToken": "stbdkkBy2XkfsiPh4cP9xev0oGL5EmiQxP1a",
    "refreshValidPeriod": 2592000,
    "tokenIp": "10.8.0.90",
    "tokenType": 0,
    "user": {
        "adminType": 2,
        "alias1": null,
        "appId": null,
        "cloudUserId": "76aaaba8a12f4c0a8a43192...",
        "companyDomain": null,
        "companyId": "f5968fc4f9c14d50905e8e66672dabc6",
        "corpType": 0,
        "freeUser": false,
        "grayUser": false,
        "headPictureUrl": null,
        "isBindPhone": null,
        "name": "xxxx_name",
        "nameEn": null,
        "numberHA1": "1ead5e5ce44849bc2718d5c....",
        "paidAccount": null,
        "paidPassword": null,
        "password": null,
        "realm": "huaweicloud.com",
        "serviceAccount": "sip:xxxx@huaweicloud.com",
        "spId": "666bd8558e4646e1a7e1a0c99cf898e8",
        "status": 0,
        "thirdAccount": "62fe180o133fd...",
        "tr069Account": "X3M537A6IX4SC...",
        "ucloginAccount": "z8b2vo875ioh54r29ad5e3552vb3gm8np2j167...",
        "userId": "0d5202707123429d876....",
        "userType": 2,
        "visionAccount": null,
        "weLinkUser": false
    },
    "validPeriod": 84616
}

Error Codes

If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.

Example cURL Command

curl -k -i -H 'content-type: application/json' -X PUT  -H 'X-Access-Token:stbo3vX1pyduWpSFsjMCmR93mJkfQGnohjvQ' 'https://api.meeting.huaweicloud.com/v1/usg/acs/token'