LogoLogo
  • Introduction
  • sdks
    • Feature Comparison
    • Unity
    • Godot
    • Defold
    • LÖVE
    • Unreal
  • Quick Start
    • Unity
    • Godot
    • Defold
    • LÖVE
    • Unreal
  • Server Side
    • Entities
    • Chunks
    • Dimensions
    • Events
    • Logging
    • Lua Environment
    • Git Primer
    • Physics
  • HTTP API
    • Authentication
    • Player API
  • Api Reference
    • Entity API
      • Create
      • Message
    • Client API
      • Message
    • Dimension API
      • Create
      • Delete
      • List
    • Events API
      • on_player_join
      • on_player_leave
    • Table API
      • Append
      • Remove
      • Join
    • Util API
      • Time
      • TimeMillis
    • HTTP Request API
      • Get
      • Post
      • Put
      • Delete
    • Physics API
      • NewBody
      • NewBoxShape
      • NewSphereShape
Powered by GitBook
On this page
  • Create New Player
  • Delete Player
  • List Players
  1. HTTP API

Player API

Premium Only

PreviousAuthenticationNextEntity API

Last updated 3 months ago

We provide an API for the creation, deletion and listing of players associated with a game.

Create New Player

To create a new player, you must send a POST request to https://api.planetaryprocessing.io/api/players with a JSON body containing the username and password of the new player. Your request must also have your game's personal in the X-API-KEY header.

{
    "username": "sam",
    "password": "agoodpassword"
}

This will return the Player ID in a JSON response:

{
    "player_id": "8a319bfb-5a71-41ed-a67c-5fd44b40fb11"
}

cURL Example

curl -X POST https://api.planetaryprocessing.io/api/players/ \
-H "X-API-KEY: yourapikeyhere" \
--data '{"username": "sam", "password": "agoodpassword"}'

Delete Player

To delete a player, you must send a DELETE request to https://api.planetaryprocessing.io/api/players with a JSON body containing the UUID of the player,.

{
    "player_id": "8a319bfb-5a71-41ed-a67c-5fd44b40fb11"
}

cURL Example

curl -X DELETE https://api.planetaryprocessing.io/api/players/ \
-H "X-API-KEY: yourapikeyhere" \
--data '{"player_id": "8a319bfb-5a71-41ed-a67c-5fd44b40fb11"}'

List Players

[
    {"username":"bill","player_id":"4fef6e6a-6d2a-446e-b13f-d67e02d1924a"},
    {"username":"stan","player_id":"57563f34-f536-4932-a7dc-3a351b6c63c3"},
]

cURL Example

curl -X GET https://api.planetaryprocessing.io/api/players/ \
-H "X-API-KEY: yourapikeyhere" 

Your request must also have your game's personal in the X-API-KEY header.

To list players, simply call GET on the https://api.planetaryprocessing.io/api/players/ endpoint with your in the X-API-KEY header. It will return a JSON array of players like so:

API Key
API Key
API key