ClassiCube Web API Documentation

Important Notes

The domain name you must use for all requests is www.classicube.net

It is heavily suggested that you always include a trailing slash with your request.

You will be sent a cookie labelled 'session' - you must send this with every request in order for the API to work.

How to interpret the usage sections

> signifies an example of incoming data (data that you will recieve).
< signifies an example of outgoing data (data that you will send).



Server documentation

Documentation for retrieving information about servers, and sending server heartbeats


Player documentation

Documentation for retrieving information about players



/api/login/

Use: Authenticates you with the site, and allows you to do things that require authentication.

Usage

Send a GET request to /api/login/ to get the "token", then send a POST request to the same page with the following parameters:

  • username - The username for the account you are authenticating as
  • password - The password for the account you are authenticating as
  • token - The token from your previous request

< GET /api/login/

> {
>	"username": null,
>	"authenticated": false,
>	"token": "f033ab37c30201f73f142449d037028d",
>	"errors": []
>}

< POST /api/login/ username=AndrewPH&password=examplePassW0rd&token=f033ab37c30201f73f142449d037028d

> {
> 	"username": "AndrewPH",
> 	"authenticated": true,
> 	"token": "33e75ff09dd601bbe69f351039152189",
> 	"errors": []
> }
				

Errors

  • token - The token you sent was incorrect.
  • username - The username you sent didn't exist.
  • password - The password you sent was incorrect.
  • verification - User is not yet verified. You'll still be logged in, but you won't be able to get mppasses for multiplayer servers.


/api/myip/

Use: Returns your external IP address.

Usage

Send a GET request to /api/myip/

< GET /api/myip

> 127.0.0.1