Aller au contenu

GET /banlist

Point final : GET /v1/pdapi/banlist

Auth : Jeton du porteur

Autorisation : REST.Banlist.Read

Objectif

Lit les enregistrements d'interdiction de la liste des interdictions. Les données liées au bannissement sont stockées dans Banlist.json, et non dans Config.json.

Paramètres du chemin

Aucun.

Paramètres de requête

  • active : true, false ou 1 pour filtrer l'état actif.
  • entryType : Filtrer par type d'entrée d'interdiction.
  • userId : Filtrer par ID utilisateur.
  • ip ou userIP : Filtrer par adresse IP.
  • issuerType, issuerName, issuerIP : filtrer par métadonnées d'émetteur.
  • reason : Filtrer par texte de raison.
  • q : Recherche de texte générale.

Corps de la demande

Aucun corps de requête.

Schéma de réponse

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.

Réponses aux erreurs

Les corps d'erreur utilisent cette forme :

{
    "Error": {
        "Code": "ERROR_CODE",
        "Message": "Human-readable message",
        "Details": {}
    }
}
HTTP Code d'erreur Quand ça arrive
401 INVALID_TOKEN L'en-tête Authorization est manquant, mal formé ou ne correspond pas à un jeton de support configuré.
403 MISSING_PERMISSION Le jeton est valide, mais il n'inclut pas cette autorisation de point de terminaison.

Exemples

Répertorier tous les enregistrements d'interdiction

GET /v1/pdapi/banlist

Rechercher des enregistrements actifs pour un utilisateur Steam

GET /v1/pdapi/banlist?active=true&userId=steam_76561198012345678

Rechercher des enregistrements par IP

GET /v1/pdapi/banlist?ip=203.0.113.42

Scénarios

  • Vérifiez si un joueur ou une adresse IP est actuellement banni.
  • Recherchez par motif ou par émetteur avant d'annuler le bannissement.
  • Créez un tableau de bord de modération qui lit de Banlist.json à API.

Connexes