Files
Caleb Gardner 40271fa088 Copied over SWAssistant and CDR backend
Started converting them to new backend
2024-08-01 07:00:00 -05:00

1.5 KiB

swassistant-backend

Custom backend for SWAssistant. Extension of darkstorm-backend

APIs

For POST requests, the X-API-Key http header must be set.

Profiles

Upload profile to share

Character, vehicles, and minion profiles.

POST: /profile?type={character|vehicle|minion}

Upload a profile. type query is required.

Request Body:

{
  // profile data
}

Note: Only allows up to 5MB of data. If over 5MB returns 413. Further limits might be imposed in the future.

Response:

{
  "id": "profile ID",
  "expiration": 0 // Unix time (Seconds) of expiration
}

Get a shared profile

GET: /profile/{profileID}

Get an uploaded profile.

Response:

{
  "type": "character|vehicle|minion",
  // profile data minus uid
}

Rooms

All room requests must include both X-API-Key and Authorization headers.

Room list

GET: /rooms

Get a list of rooms your currently a part of.

Response:

[
  {
    "id": "room ID",
    "name": "room name",
    "owner": "username"
  }
]

Create new room

POST: /rooms/new?name={roomName}

Create a new room. name query is required.

Response:

{
  "id": "room ID",
  "name": "room name"
}

Get room info

GET: /rooms/{roomID}

Get info about a room.

{
  "id": "room ID",
  "name": "room name",
  "owner": "username",
  "users": [
    "username"
  ],
  "profiles": [
    "profile uuids"
  ]
}