get-private-tokens.rst (1898B)
1 .. http:get:: [/instances/$INSTANCE]/private/tokens 2 3 Retrieve a list of issued access tokens for ``$INSTANCE``. 4 5 @since **v19** 6 7 **Required permission**: ``tokens-read`` 8 9 **Request:** 10 11 :query limit: *Optional.* 12 At most return the given number of results. Negative for descending by ``serial``, positive for ascending by ``serial``. Defaults to ``-20``. 13 :query offset: *Optional.* 14 Starting ``serial`` for :ref:`pagination <row-id-pagination>`. 15 16 **Response:** 17 18 :http:statuscode:`200 OK`: 19 Response is a `TokenInfos`. 20 :http:statuscode:`204 No content`: 21 No tokens. 22 :http:statuscode:`400 Bad Request`: 23 The request is malformed. 24 Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. 25 :http:statuscode:`401 Unauthorized`: 26 Invalid or missing credentials. 27 Returned with ``TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED``. 28 :http:statuscode:`404 Not found`: 29 The backend has does not know about the instance. 30 Returned with ``TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN``. 31 :http:statuscode:`500 Internal Server Error`: 32 The server experienced an internal failure. 33 Returned with ``TALER_EC_GENERIC_DB_FETCH_FAILED``. 34 35 **Details:** 36 37 .. ts:def:: TokenInfos 38 39 interface TokenInfos { 40 tokens: TokenInfo[]; 41 } 42 43 .. ts:def:: TokenInfo 44 45 interface TokenInfo { 46 // Time when the token was created. 47 creation_time: Timestamp; 48 49 // Time when the token expires. 50 expiration: Timestamp; 51 52 // Scope for the token. 53 scope: "readonly" | "readwrite" | ...; 54 55 // Is the token refreshable into a new token during its 56 // validity? 57 // Refreshable tokens effectively provide indefinite 58 // access if they are refreshed in time. 59 refreshable: boolean; 60 61 // Optional token description 62 description?: string; 63 64 // Opaque unique ID used for pagination. 65 serial: Integer; 66 }