GET /banlist
Конечная точка: GET /v1/pdapi/banlist
Аутентификация: Токен носителя
Разрешение: REST.Banlist.Read
Цель
Считывает записи о банах из списка банов. Данные, связанные с баном, хранятся в Banlist.json, а не в Config.json.
Параметры пути
Нет.
Параметры запроса
active:true,falseили1для фильтрации активного состояния.entryType: фильтрация по типу записи о запрете.userId: фильтрация по идентификатору пользователя.ipилиuserIP: фильтрация по IP-адресу.issuerType,issuerName,issuerIP: фильтрация по метаданным эмитента.reason: фильтрация по тексту причины.q: Общий текстовый поиск.
Тело запроса
Нет тела запроса.
Схема ответа
200 response schema
| Field | Type | Description |
|---|---|---|
Banlist |
object | Banlist data after applying query filters. |
Banlist object schema:
| Field | Type | Description |
|---|---|---|
Version |
integer | Banlist file format version. |
BannedMessage |
string | Message shown to banned players. |
UserEntries |
object[] | User ban entries that match the supplied filters. |
IPEntries |
object[] | IP ban entries that match the supplied filters. |
UserEntries[] item schema:
| Field | Type | Description |
|---|---|---|
UserId |
string | Banned user ID. |
Active |
boolean | Whether the ban is currently active. |
BannedBy |
object | Issuer data for the ban action. |
UnbannedBy |
object | Issuer data for the unban action, when present. |
IPEntries[] item schema:
| Field | Type | Description |
|---|---|---|
IP |
string | Banned IP address. |
Active |
boolean | Whether the ban is currently active. |
BannedBy |
object | Issuer data for the ban action. |
UnbannedBy |
object | Issuer data for the unban action, when present. |
Issuer object schema:
| Field | Type | Description |
|---|---|---|
Type |
string | Issuer type, such as rest, player, or system. |
NameValue |
string | Issuer name, user ID, token, or type fallback. |
IP |
string | Issuer IP address metadata. |
Reason |
string | Reason recorded for the action. |
Timestamp |
object | UTC timestamp components for the action. |
Timestamp object schema:
| Field | Type | Description |
|---|---|---|
UTC |
integer | Unix timestamp in seconds. |
Year |
integer | UTC year. |
Month |
integer | UTC month. |
Day |
integer | UTC day of month. |
Hour |
integer | UTC hour. |
Min |
integer | UTC minute. |
Sec |
integer | UTC second. |
Msec |
integer | Millisecond component. |
Реакции на ошибки
Тела ошибок используют следующую форму:
| HTTP | Код ошибки | Когда это произойдет |
|---|---|---|
401 |
INVALID_TOKEN |
Заголовок Authorization отсутствует, имеет неправильный формат или не соответствует настроенному токену носителя. |
403 |
MISSING_PERMISSION |
Токен действителен, но не включает это разрешение конечной точки. |
Примеры
Список всех записей о банах
Найти активные записи пользователя Steam
Поиск записей по IP
Сценарии
- Проверьте, забанен ли игрок или IP в данный момент.
- Прежде чем снимать бан, выполните поиск по причине или эмитенту.
- Создайте панель модерации, которая считывает данные от
Banlist.jsonдо API.