Aller au contenu

GET /items/{player_identifier}

Point final : GET /v1/pdapi/items/<player_identifier>

Auth : Jeton du porteur

Autorisation : REST.Items.Read

Objectif

Répertorie les objets du joueur cible. Les identifiants d'éléments dans les réponses peuvent être recherchés sur paldeck.cc/items.

Paramètres du chemin

  • player_identifier : UserId ou PlayerUID pour le joueur cible.

Paramètres de requête

Aucun.

Corps de la demande

Aucun corps de requête.

Schéma de réponse

200 response schema

Field Type Description
Meta object Target player metadata.
Inventory object Inventory containers for the target player.

Meta object schema:

Field Type Description
PlayerUID string Player UID used by Palworld save data.
Player string Player identifier supplied in the request path.

Inventory object schema:

Field Type Description
Items object Common inventory container.
KeyItems object Key item inventory container.
Weapons object Weapon loadout inventory container.
Armor object Armor inventory container.
Food object Food inventory container.
DropSlot object Drop slot inventory container.

Inventory container object schema:

Field Type Description
Available boolean Whether the container was available.
ContainerID string Palworld container ID, or an empty string when unavailable.
UsedSlots integer Number of occupied slots.
MaxSlots integer Total slot count.
FreeSlots integer Number of free slots.
Slots object Occupied slots keyed by slot index.

Slots item schema:

Field Type Description
ItemID string Palworld item identifier.
Count integer Stack count in the slot.

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.
400 INVALID_JSON Un corps de requête a été fourni, mais il n'a pas pu être analysé comme JSON.
400 REQUEST_FAILED Le joueur cible, l'état du joueur, les données d'inventaire ou le conteneur d'inventaire commun n'ont pas pu être résolus.
500 REQUEST_TIMEOUT Le rappel du thread de jeu interne ne s'est pas terminé dans les 5 secondes.

Exemples

Lire l'inventaire d'un joueur Steam

GET /v1/pdapi/items/steam_76561198087654321

Lire l'inventaire d'un joueur GDK

GET /v1/pdapi/items/gdk_2533274812345678

Scénarios

  • Vérifiez l’inventaire avant d’accorder une compensation.
  • Confirmez un ItemID avant d'utiliser POST /give/items.
  • Résoudre les rapports sur les éléments manquants.