Lista tokenów API
/user/api-tokensPobierz listę tokenów API użytkownika.
Ta metoda wymaga autoryzacji!
Możesz skorzystać z własnego klucza API, który znajdziesz pod adresem {panel sterowania.
Ta metoda - wymaga uprawnień -api-tokens.read
Tworząc token API w swoim panelu sterowania, możesz wybrać określone uprawnienia (np. uniemożliwić tokenowi składanie zamówień).
Listę uprawnień znajdziesz także w naszej dokumentacji.
Listę uprawnień znajdziesz także w naszej dokumentacji.
Metoda zapytania
GEThttps://api.stableproxy.com/v2/user/api-tokens
Parametry zapytania
| Identyfikator | Regulamin | Przykład |
|---|---|---|
| searchNie koniecznie | nullablestring | 144 |
| per-pageNie koniecznie | nullableinteger | 73 |
| pageNie koniecznie | nullableinteger | 18 |
| sort-byNie koniecznie | nullablestringapp\_validators\_ex_in_rule | "" |
| sort-orderNie koniecznie | nullablestringin:asc, desc | "asc" |
Przykłady kodu
1const baseUrl = "https://api.stableproxy.com/v2";2const response = await fetch(baseUrl + "/user/api-tokens", {3 method: "GET",4 headers: {5 "Authorization": "API-Token [YOUR TOKEN]",6 "Content-Type": "application/json"7 }8});9const data = await response.json();Przykłady odpowiedzi
Success response200application/json
{
"data": {
"current_page": 1,
"data": [
{
"id": 75,
"tokenable_id": 1,
"name": "",
"type": "api",
"abilities": [
"*"
],
"last_used_at": "2023-12-21T13:41:38.000000Z",
"created_at": "2023-10-31T23:55:08.000000Z",
"updated_at": "2023-12-21T13:41:38.000000Z",
"expires_at": null,
"deleted_at": null,
"is_current": true
}
],
"first_page_url": "http://apidev.stableproxy.com/v2/user/api-tokens?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://apidev.stableproxy.com/v2/user/api-tokens?page=1",
"next_page_url": null,
"path": "http://apidev.stableproxy.com/v2/user/api-tokens",
"per_page": 25,
"prev_page_url": null,
"to": 20,
"total": 20
},
"good": true,
"timestamp": 1703166098,
"cause": {
"type": "api",
"user_id": 1,
"token_id": 75,
"token_sign": "63992323944b77852d3b2b901498fc57"
}
}