[comment]: # translation:outdated

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

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

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

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

Questo metodo consente di aggiornare token esistenti.

::: noteclassic
Per il ruolo utente è necessaria l'[autorizzazione](/manual/web_interface/frontend_sections/users/user_roles#configuration) *Manage API tokens* per gestire i token di altri utenti.
:::

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

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

`(object/array)` Proprietà del token da aggiornare.

La proprietà `tokenid` deve essere definita per ciascun token; tutte le altre
proprietà sono facoltative. Verranno aggiornate solo le proprietà passate, mentre
tutte le altre rimarranno invariate.

Il metodo accetta token con le [proprietà standard del token](object).

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

[comment]: # ({d0adc398-d0adc398})
### Valori di ritorno

`(object)` Restituisce un oggetto contenente gli ID dei token aggiornati
sotto la proprietà `tokenids`.

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

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

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

[comment]: # ({305dae6e-4f041664})
#### Rimuovere la scadenza del token

Rimuovere la data di scadenza dal token.

[Richiesta](/manual/api#performing-requests):

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

Risposta:

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

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

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

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

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