get-accounts-USERNAME-tokens.rst (1888B)
1 .. http:get:: /accounts/$USERNAME/tokens 2 3 Retrieve a subset of tokens related to $USERNAME. 4 @since **v4** 5 6 **Request:** 7 8 :query limit: *Optional.* 9 At most return the given number of results. Negative for descending by ``token_id``, positive for ascending by ``token_id``. Defaults to ``-20``. Since **v5**. 10 :query offset: *Optional.* 11 Starting ``token_id`` for :ref:`pagination <row-id-pagination>`. Since **v5**. 12 :query delta: *Optional.* 13 Deprecated since **v5**. Use *limit* instead. 14 :query start: *Optional.* 15 Deprecated since **v5**. Use *offset* instead. 16 17 **Response:** 18 19 :http:statuscode:`200 OK`: 20 Response is a `TokenInfos`. 21 :http:statuscode:`204 No content`: 22 No tokens. 23 :http:statuscode:`401 Unauthorized`: 24 Invalid or missing credentials. 25 :http:statuscode:`403 Forbidden`: 26 Mmissing rights. 27 28 **Details:** 29 30 .. ts:def:: TokenInfos 31 32 interface TokenInfos { 33 tokens: TokenInfo[]; 34 } 35 36 .. ts:def:: TokenInfo 37 38 interface TokenInfo { 39 // Time when the token was created. 40 creation_time: Timestamp; 41 42 // Expiration determined by the server. 43 // Can be based on the token_duration 44 // from the request, but ultimately the 45 // server decides the expiration. 46 expiration: Timestamp; 47 48 // Scope for the token. 49 scope: "readonly" | "readwrite" | "revenue" | "wiregateway"; 50 51 // Is the token refreshable into a new token during its 52 // validity? 53 // Refreshable tokens effectively provide indefinite 54 // access if they are refreshed in time. 55 refreshable: boolean; 56 57 // Optional token description 58 description?: string; 59 60 // Time when the token was last used. 61 last_access: Timestamp; 62 63 // ID identifying the token 64 token_id: Integer; 65 66 // deprecated since **v9**. Use *token_id* instead. 67 row_id: Integer; 68 }