0% found this document useful (0 votes)
238 views11 pages

Cubash API Documentation

The document outlines the API endpoints and authentication methods for a social platform. It includes endpoints for user profiles, friends, messages, games and a store. Authentication is required for protected endpoints and involves login, logout and managing sessions. Cookies and tokens are used to maintain authenticated sessions.

Uploaded by

ofre eqw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views11 pages

Cubash API Documentation

The document outlines the API endpoints and authentication methods for a social platform. It includes endpoints for user profiles, friends, messages, games and a store. Authentication is required for protected endpoints and involves login, logout and managing sessions. Cookies and tokens are used to maintain authenticated sessions.

Uploaded by

ofre eqw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

- Tags:

[AUTH]:
This means the request requires a valid "cubash_guard" cookie to work.

Cookies:
cubash_guard = "xxx" | [acquired through a successful login response,
its stored in the response cookies as "cubash_guard"]
[SESSION]:
This means the request requires session identifiers to work.

Headers:
X-CSRF-TOKEN = "xxx" | [acquired through a successful session response,
its stored in the JSON body as "csrf"]

Cookies:
_csrf = "xxx" | [acquired through a successful session response, its
stored in the response cookies as "_csrf"]

Get user headshot:


- Method: GET
- Endpoint: [Link]
- Parameters:
value = Username
- Response:
Body [JSON]: {
"headshot":"[Link]
}

Get session:
- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"authenticated":false,
"user":{},
"csrf":"xxx",
"alerts":[]
}
Cookies:
_csrf = "xxx"

Login [SESSION]:
- Method: POST
- Endpoint: [Link]

- Request:
Body [JSON]: {
"username":"name",
"password":"password"
}

- Response:
Cookies:
cubash_guard = "xxx"

Logout [SESSION] [AUTH]:


- Method: DELETE
- Endpoint: [Link]

Get profile:
- Method: GET
- Endpoint: [Link]

- Parameters:
username = Username
- Response:
Body [JSON]: {
"user": {
"id":1,
"username":"name",
"about":"bio"
},
"avatar":{
"thumbnail":"[Link]
},
"meta":{
"created":"YYYY-MM-DDT00:MM:[Link]",
"last_seen":"YYYY-MM-DDTHH:MM:[Link]",
"staff":false,
"online":true,
"forum_posts":0,
"suspended":false,
"profile_views":0
}
}

Get friends:
- Method: GET
- Endpoint: [Link]
username={}&page={}&mode={}

- Parameters:
username = Username
page = Page
mode = "profile" | "dashboard" | "overview"
- Response:
Body [JSON]: {
"objects":[
{
"username":"FriendName",
"thumbnail":"[Link]
"headshot":"[Link]
"online":false
}
],
"meta":{
"pages":1,
"count":1
}
}

Get messages [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]
- Parameters:
page = Page
- Response:
Body [JSON]: {
"pages":1,
"messages":[
{
"author":{
"online":false,
"username":"Alt",
"headshot":"[Link]
},
"message":"message",
"created":"YYYY-MM-DDT00:MM:[Link]"
},
{
"author":{
"online":false,
"username":"AuthorName",
"headshot":"[Link]
},
"message":"message",
"created":"YYYY-MM-DDT00:MM:[Link]"
}
]
}

Send message [SESSION] [AUTH]:


- Method: PUT
- Endpoint: [Link]

- Request:
Body [JSON]: {
"message": "message"
}

Get own Account [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"id":1,
"created":"YYYY-MM-DDT00:MM:[Link]",
"last_session_purge":null,
"last_password_change":null,
"totp_setup":false
}

Get own Profile [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"about_me":"ur own about me"
}

Get 2FA [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"enabled":false
}

Get Sessions [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"sessions":[
{
"platform":"Microsoft Windows",
"browser":"Firefox 105.0",
"current":true,
"last_used":"YYYY-MM-DDT00:MM:[Link]"
}
]
}

Purge Sessions [SESSION] [AUTH]:


- Method: PATCH
- Endpoint: [Link]

- Request:
Body [JSON]: {
"password": "password"
}

Change Password [SESSION] [AUTH]:


- Method: PATCH
- Endpoint: [Link]

- Request:
Body [JSON]: {
"current_password":"current_password",
"new_password":"new_password"
}

Change email [SESSION] [AUTH]:


- Method: PATCH
- Endpoint: [Link]

- Request:
Body [JSON]: {
"email":"google@[Link]",
"password":"password"
}

Request email Verification Link [SESSION] [AUTH]:


- Method: POST
- Endpoint: [Link]

Get forum categories:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: TOO LARGE - CHECK URSELF BY REQUESTING ON THE ENDPOINT

Get forum Posts:


- Method: GET
- Endpoint: [Link]

- Parameters:
id = Category ID
page = Page
- Response:
Body [JSON]: TOO LARGE - CHECK URSELF BY REQUESTING ON THE ENDPOINT

Get forum Posts:


- Method: GET
- Endpoint: [Link]

- Parameters:
id = Category ID
page = Page
search = search string
- Response:
Body [JSON]: TOO LARGE - CHECK URSELF BY REQUESTING ON THE ENDPOINT

Get games:
- Method: GET
- Endpoint: [Link]

- Parameters:
page = Page
view = "regular" |
- Response:
Body [JSON]: {
"pages":47,
"levels":[
{
"level":{
"id":1,
"name":"Icseon's Game",
"description":"Hello world",
"thumbnail":"[Link]
"meta":{
"online_players":2
}
},
"author":{
"username":"Icseon",
"headshot":"[Link]
}
}
]
}

Get game:
- Method: GET
- Endpoint: [Link]
- Parameters:
id = Game Id
- Response:
Body [JSON]: {
"author":{
"username":"Icseon",
"headshot":"[Link]
},
"game":{
"name":"Icseon's Game",
"description":"Hello world",
"created":"YYYY-MM-DDT00:MM:[Link]",
"updated":"YYYY-MM-DDT00:MM:[Link]",
"author":false,
"thumbnail":"[Link]
},
"meta":{
"online_players":1,
"plays":328,
"disabled":false
}
}

Get game Servers:


- Method: GET
- Endpoint: [Link]

- Parameters:
id = Game Id
- Response:
Body [JSON]: [
{
"id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"playing":1,
"players":[
{
"username":"player",
"headshot":"[Link]
}
]
}
]

Request game token [SESSION] [AUTH]:


- Method: PUT
- Endpoint: [Link]

- Request:
- Body [JSON]: {
"id":"1",
"server_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

"server_id" is OPTIONAL, without it you will get a token for a random


server.
- Response:
Body [JSON]: {
"token":"xxx"
}
This token can be used to launch and join a game. "cubash://client/xxx"

Get store Items:


- Method: GET
- Endpoint: [Link]

- Parameters:
type = "hats" | "faces" | "tools" | "shirts" | "pants"
page = page
- Response:
Body [JSON]: {
"pages":2,
"items":[
{
"item":{
"id":790,
"name":"Autumn Witch",
"buyable":true,
"price":30,
"thumbnail":"[Link]
},
"user":{
"username":"Cubash",
"staff":false,
"headshot":"[Link]
}
}
]
}

Get item:
- Method: GET
- Endpoint: [Link]

- Parameters:
id = Item Id
- Response:
Body [JSON]: {
"item":{
"thumbnail":"[Link]
"name":"Autumn Witch",
"description":"Tread carefully within these woods, a witch might
turn you into a tree!",
"type":"hats",
"price":30
},
"meta":{
"reviewed":true,
"approved":true,
"created":"YYYY-MM-DDT00:MM:[Link]",
"buyable":true,
"owners":58,
"owned":false
},
"author":{
"username":"Cubash",
"headshot":"[Link]
}
}

Get owned Items [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Parameters:
type = "hats" | "faces" | "tools" | "shirts" | "pants"
show = "all" | "wearing"
page = page
- Response:
Body [JSON]: {
"items":[
{
"id":587,
"name":"Coffee",
"thumbnail":"[Link]
"wearing":true,
"approved":true
}
],
"pages":1
}

Equip/Unequip item [SESSION] [AUTH]:


Equip:
- Method: PATCH
Unequip:
- Method: DELETE

- Endpoint: [Link]

- Request:
- Body [JSON]: {
"item_id":587
}
- Response:
Body [JSON]: {
"urls":{
"thumbnail":"[Link]
"headshot":"[Link]
},
"wearing":[
587
]
}

"wearing" does not get sent when using "DELETE"

Change skincolor [SESSION] [AUTH]:


- Method: PATCH
- Endpoint: [Link]

- Request:
- Body [JSON]: {
"part":"head",
"color":"#000000"
}
"part": "head", "torso", "right_arm", "right_leg", "left_arm", "left_leg"

- Response:
Body [JSON]: {
"thumbnail":"[Link]
"headshot":"[Link]
}

Get character State [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Response:
Body [JSON]: {
"character":{
"colors":{
"head":"#ff00ff",
"torso":"#ff00ff",
"left_arm":"#ff00ff",
"left_leg":"#ff00ff",
"right_arm":"#ff00ff",
"right_leg":"#ff00ff"
}
},
"colors":[ "#000000", "#030303", "#0c090a", "#2c3539", "#2b1b17",
"#34282c", "#25383c", "#3b3131", "#413839", "#3d3c3a", "#463e3f", "#4c4646",
"#504a4b", "#565051", "#5c5858", "#625d5d", "#666362", "#6d6968", "#726e6d",
"#736f6e", "#837e7c", "#848482", "#b6b6b4", "#d1d0ce", "#eeeeee", "#bcc6cc",
"#98afc7", "#6d7b8d", "#657383", "#616d7e", "#646d7e", "#566d7e", "#737ca1",
"#4863a0", "#2b547e", "#34495e", "#2b3856", "#151b54", "#000080", "#342d7e",
"#15317e", "#151b8d", "#0000a0", "#0020c2", "#0041c2", "#2554c7", "#1569c7",
"#2b60de", "#1f45fc", "#6960ec", "#736aff", "#357ec7", "#368bc1", "#488ac7",
"#3090c7", "#659ec7", "#87afc7", "#95b9c7", "#728fce", "#2b65ec", "#306eff",
"#157dec", "#1589ff", "#6495ed", "#6698ff", "#38acec", "#56a5ec", "#2196f3",
"#5cb3ff", "#3bb9ff", "#79baec", "#82cafa", "#82caff", "#a0cfec", "#b7ceec",
"#b4cfec", "#c2dfff", "#c6deff", "#afdcec", "#addfff", "#bdedff", "#93ffe8",
"#9afeff", "#7fffd4", "#00ffff", "#7dfdfe", "#57feff", "#8eebec", "#50ebec",
"#4ee2ec", "#81d8d0", "#92c7c7", "#77bfc7", "#78c7c7", "#48cccd", "#43c6db",
"#46c7c7", "#7bccb5", "#43bfc7", "#3ea99f", "#3b9c9c", "#438d80", "#348781",
"#307d7e", "#5e7d7e", "#4c787e", "#008080", "#4e8975", "#78866b", "#848b79",
"#617c58", "#728c00", "#667c26", "#254117", "#306754", "#347235", "#437c17",
"#137e07", "#387c44", "#347c2c", "#347c17", "#348017", "#4e9258", "#6aa121",
"#4aa02c", "#41a317", "#3ea055", "#6cbb3c", "#6cc417", "#4cc417", "#52d017",
"#4cc552", "#54c571", "#99c68e", "#89c35c", "#85bb65", "#8bb381", "#9cb071",
"#b2c248", "#9dc209", "#a1c935", "#7fe817", "#59e817", "#57e964", "#64e986",
"#5efb6e", "#00ff00", "#5ffb17", "#87f717", "#8afb17", "#6afb92", "#98ff98",
"#b5eaaa", "#c3fdb8", "#ccfb5d", "#b1fb17", "#bce954", "#edda74", "#ede275",
"#f8e709", "#ffe87c", "#ffdb58", "#ffd801", "#fdd017", "#eac117", "#f5c86a",
"#f2bb66", "#fbb917", "#fbb117", "#ffa62f", "#e9ab17", "#e2a76f", "#deb887",
"#f9dda2", "#ffcba4", "#c9be62", "#e8a317", "#ee9a4d", "#c8b560", "#d4a017",
"#c2b280", "#c7a317", "#c68e17", "#b5a642", "#ada96e", "#c19a6b", "#cd7f32",
"#c88141", "#c58917", "#af9b60", "#af7817", "#b87333", "#966f33", "#806517",
"#827839", "#827b60", "#786d5f", "#493d26", "#483c32", "#613b09", "#6f4e37",
"#835c3b", "#7f5217", "#7f462c", "#c47451", "#c36241", "#c35817", "#c85a17",
"#cc6600", "#e56717", "#e66c2c", "#f87217", "#f87431", "#e67451", "#ff8040",
"#f88017", "#ff7f50", "#f88158", "#f9966b", "#e78a61", "#e18b6b", "#e77471",
"#f75d59", "#e55451", "#e55b3c", "#ff0000", "#ff2400", "#f62217", "#f70d1a",
"#c30404", "#f62817", "#e42217", "#e41b17", "#dc381f", "#c34a2c", "#c24641",
"#c04000", "#c11b17", "#9f000f", "#990012", "#8c001a", "#954535", "#7e3517",
"#8a4117", "#7e3817", "#800517", "#810541", "#7d0541", "#7e354d", "#7d0552",
"#7f4e52", "#7f5a58", "#7f525d", "#b38481", "#c5908e", "#c48189", "#c48793",
"#e8adaa", "#ecc5c0", "#edc9af", "#fdd7e4", "#fcdfff", "#ffdfdd", "#fbbbb9",
"#faafbe", "#faafba", "#f9a7b0", "#e7a1b0", "#e799a3", "#e38aae", "#f778a1",
"#e56e94", "#f660ab", "#fc6c85", "#f6358a", "#f52887", "#e45e9d", "#e4287c",
"#f535aa", "#ff00ff", "#e3319d", "#f433ff", "#fc6cd8", "#d16587", "#c25a7c",
"#ca226b", "#c12869", "#c12267", "#c25283", "#c12283", "#b93b8f", "#7e587e",
"#571b7e", "#583759", "#4b0082", "#461b7e", "#4e387e", "#614051", "#5e5a80",
"#6a287e", "#7d1b7e", "#a74ac7", "#b048b5", "#a36cde", "#6c2dc7", "#842dce",
"#8d38c9", "#7a5dc7", "#7f38ec", "#8e35ef", "#893bff", "#8467d7", "#a23bec",
"#b041ff", "#c45aec", "#9172ec", "#9e7bff", "#d462ff", "#e238ec", "#c38ec7",
"#c8a2c8", "#e6a9ec", "#e0b0ff", "#c6aec7", "#f9b7ff", "#d2b9d3", "#d9cfec",
"#ebdde2", "#e3e4fa" ]
}

Get incoming friend requests [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Parameters:
page = Page
mode = "overview"
- Response:
Body [JSON]: TOO LARGE - CHECK URSELF BY REQUESTING ON THE ENDPOINT

Get outgoing friend requests [SESSION] [AUTH]:


- Method: GET
- Endpoint: [Link]

- Parameters:
page = Page
mode = "overview"
- Response:
Body [JSON]: TOO LARGE - CHECK URSELF BY REQUESTING ON THE ENDPOINT

Accept/Ignore friendrequest [SESSION] [AUTH]:


Accept:
- Method: PUT
Ignore:
- Method: DELETE

- Endpoint: [Link]

- Request:
- Body [JSON]: {
"username":"username"
}

Send friendrequest [SESSION] [AUTH]


- Method: PUT
- Endpoint: [Link]

- Request:
- Body [JSON]: {
"username":"username"
}

Cancel friendrequest [SESSION] [AUTH]


- Method: DELETE
- Endpoint: [Link]

- Request:
- Body [JSON]: {
"username":"username"
}

Purchase Item [SESSION] [AUTH]:


- Method: POST
- Endpoint: [Link]

- Request:
- Body [JSON]: {
id: "1"
}

Create a game [SESSION] [AUTH]:


- Method: PUT
- Endpoint: [Link]

- Request:
- Body [JSON]: {
"name":"Title",
"description":"Description"
}
- Response:
- Body [JSON]: {
"id":"1"
}

You might also like