Skip to content
Mike J. Renaker / "MikeDEV edited this page Apr 3, 2024 · 2 revisions

API

The CloudLink Omega API utilizes simple REST requests that are either application/json or text/plain requests/responses.

The public CLΩ API server is available at https://omega.mikedev101.cc/api/v0.

Creating an account

Request

URL

POST /api/v0/register

Body

Use application/json.

{
    "username": string,
    "password": string,
    "email": string,
}

Requirements

  • Username must be at least 3 characters long, and no longer than 20.
  • Password must be at least 8 characters long, and no longer than 128.
  • A valid email address must be provided.

Response

Successful

Code

201 Created

Output body

OK

Validation failure

Code

400 Bad Request

Example body

Validation failed:
username: required
password: required
email: required

Logging in / getting a session token

Request

URL

POST /api/v0/login

Body

Use application/json.

{
    "email": string,
    "password": string,
}

Requirements

  • A valid email address must be provided.
  • Password must be at least 8 characters long, and no longer than 128.

Response

Successful

Code

200 OK

Output body

(A ULID string will be generated here - This will be your session token. Expires after 24 hours)

Validation failure

Code

400 Bad Request

Example body

Validation failed:
email: required
password: required

Writing to a save slot

Request

URL

POST /api/v0/save

Body

Use application/json.

{
    "save_data": string, // Contents to save
    "save_slot": int, // 1-10
    "token": string, // Session token
    "ugi: string, // Selected game to save to
}

Requirements

  • Token must be valid.
  • Save slot # must be a number between 1 and 10.
  • Save data must not be larger than 10,000 characters.

Response

Successful

Code

200 OK

Output body

OK

Invalid session or expired token

Code

401 Unauthorized

Example body

session not found

or

Session token has expired.

Validation error

Code

400 Bad Request

Example body

Validation failed:
ugi: required
token: required
save_data: required
save_slot: required

Reading from a save slot

Request

URL

POST /api/v0/load

Body

Use application/json.

{
    "save_slot": int, // 1-10
    "token": string, // Session token
    "ugi: string, // Selected game to load from
}

Requirements

  • Token must be valid.
  • Save slot # must be a number between 1 and 10.

Response

Successful

Code

200 OK

Output body

(contents of save slot)

Invalid session or expired token

Code

401 Unauthorized

Example body

session not found

or

Session token has expired.

Validation error

Code

400 Bad Request

Example body

Validation failed:
ugi: required
token: required
save_slot: required