Lista sesji
/user/sessionsPobierz aktywne sesje użytkowników.
Ta metoda wymaga autoryzacji!
Możesz skorzystać z własnego klucza API, który znajdziesz pod adresem {panel sterowania.
Ta metoda - wymaga uprawnień -sessions.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/sessions
Parametry zapytania
| Identyfikator | Regulamin | Przykład |
|---|---|---|
| include-apiNie koniecznie | nullableex-boolean | false |
| searchNie koniecznie | nullablestring | 195 |
| per-pageNie koniecznie | nullableinteger | 95 |
| pageNie koniecznie | nullableinteger | 8 |
| 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/sessions", {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": 105,
"tokenable_id": 2,
"name": "Email",
"type": "login",
"ip": "127.0.0.1",
"last_used_ip": "111.224.151.222",
"ip_data": {
"ip": "36.49.69.236",
"country_code": "CN",
"city": "Changchun",
"region": "Jilin",
"timezone": "Asia/Shanghai"
},
"device_type": "desktop",
"device": null,
"platform": "Windows",
"browser": "Chrome",
"city": "Changchun",
"region": "Jilin",
"country": "CN",
"abilities": [
"*"
],
"last_used_at": "2023-12-18T20:54:28.000000Z",
"created_at": "2023-11-07T03:54:05.000000Z",
"updated_at": "2023-12-18T20:54:28.000000Z",
"expires_at": "2024-01-06T03:54:05.000000Z",
"deleted_at": null,
"is_current": true
}
],
"first_page_url": "http://api.stableproxy.com/v2/user/sessions?page=1",
"from": 1,
"last_page": 2,
"last_page_url": "http://api.stableproxy.com/v2/user/sessions?page=2",
"next_page_url": "http://api.stableproxy.com/v2/user/sessions?page=2",
"path": "http://api.stableproxy.com/v2/user/sessions",
"per_page": 25,
"prev_page_url": null,
"to": 25,
"total": 35
},
"good": true,
"timestamp": 1702932869,
"cause": {
"type": "user",
"user_id": 2,
"token_id": 105,
"token_sign": "ff1e0ac8436947a0b8a06fe0a4a9e221"
}
}