This is a translation of the original English documentation page. Help us make it better.

token.update

Description

object token.update(object/array tokens)

This method allows to update existing tokens.

Only Super admin user type is allowed to manage tokens for other users.

Parameters

(object/array) Token properties to be updated.

The tokenid property must be defined for each token, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

The method accepts tokens with the standard token properties.

Return values

(object) Returns an object containing the IDs of the updated tokens under the tokenids property.

Приклади

Rename token

Remove expiry date from token.

Request:

{
           "jsonrpc": "2.0",
           "method": "token.update",
           "params": {
               "tokenid": "2",
               "expires_at": "0"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "tokenids": [
                   "2"
               ]
           },
           "id": 1
       }

Source

CToken::update() in ui/include/classes/api/services/CToken.php.