list

To get the list of tokens, use the token/list method.

Copied!
svc=token/list&params={"userId":<text>}

Parameters

The request can contain the userId parameter, specifying the subuser ID. The parameter is optional.

Response

If the request is completed successfully, a response of the following format is returned:

Copied!
[
  {
    "h": <text>,        /* Unique token name, 72 symbols. */
    "app": <text>,      /* Application name. */
    "at": <uint>,       /* Token activation time, UNIX time. */
    "ct": <uint>,       /* Token creation time, UNIX time. */
    "dur": <uint>,      /* Token duration after activation, in seconds. */
    "fl": <uint>,       /* Access flags. */
    "items": [<long>],  /* List of item IDs to which the token grants access. */
    "p": <text>,        /* Custom parameters; the value must be an object or an array of objects. */
    "ll": <uint>        /* Last authorization time, UNIX time. */
  },
  ...                   /* Other tokens (if any). */
]

If the request fails, an error code is returned.

Error codes

Error code Description
1 Invalid session.
7 One of the following errors:
  • The session is opened with a token whose access flags differ from -1 or which grants access only to certain items (see Access flags).
  • The user specified in the userId parameter isn’t found, or you have no Act on behalf of this user access right to this user.

If you find a mistake in the text, please select it and press Ctrl+Enter.