[comment]: # ({7063b41c-7063b41c})
# token.update

[comment]: # ({/7063b41c-7063b41c})

[comment]: # ({677d903b-f2679bab})
### 説明

`object token.update(object/array tokens)`

このメソッドは、既存のトークンを更新することができます。

::: noteclassic
他のユーザーのトークンを管理するには、ユーザーの役割に*APIトークンの管理*の[権限](/manual/web_interface/frontend_sections/users/user_roles#configuration)が必要です。
:::

[comment]: # ({/677d903b-f2679bab})

[comment]: # ({416a8426-416a8426})
### パラメータ

`(object/array)` 更新されるトークンプロパティ

`tokenid`プロパティはトークンごとに定義する必要があり、すべてのプロパティはオプションです。 渡されたプロパティのみが更新され、他のプロパティは変更されません。

このメソッドは[標準トークンプロパティ](object)を持つトークンを受け入れます。

[comment]: # ({/416a8426-416a8426})

[comment]: # ({d0adc398-d0adc398})
### 戻り値

`(object)` `tokenids`プロパティの下で更新されたトークンのIDを含むオブジェクトを返します。

[comment]: # ({/d0adc398-d0adc398})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({63919922-4f041664})
#### トークンの有効期限変更

トークンから有効期限を削除します。

Request:

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

Response:

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

[comment]: # ({/63919922-4f041664})

[comment]: # ({63651b34-63651b34})
### ソース

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

[comment]: # ({/63651b34-63651b34})
