API account login


Introduction —> How The Website Works —> API —> API account login

API - request to /account/login

The /account/login API call is used by a player to authenticate themselves with the Planets.nu server. The player provides a username and password and returns a security key called the apikey.

The apikey is used in many of the other API calls when accessing information that is available only to that player (or to Planets.nu administrators). Specifically, it is needed to access in-game data when games are still running.

There are, however, many API calls that return public information (about a player, or a game etc) and these do not require an apikey.

The apikey is in the form of a Universally unique identifier (UUID). Each apikey is unique and with 2^128 combinations is effectively secure. How the server generates the apikey from the username and password is unknown.

Data Sent

The following data is accepted by the interface:

Data Description
username Player's username (case insensitive - required)
password Player's password (case sensitive - required)

Data Returned

The following data is returned by the interface:

Data Description
success True
apikey Player's apikey (for example 01a3b5f7-de15-4ef6-67ff-48a5cd66a143)

Notes

Failures

{"success":false,"error":"Missing required parameter - username"}

{"success":false,"error":"Missing required parameter - password"}

{"success":false,"error":"Invalid username or password."}

Back