User
Headers
The following headers need to be sent with any request
| Name | Value |
|---|---|
| Content-Type | application/json |
| Cookies | username & token |
Retrieving
GET /user
Retrieving data about the current user
Response
- 200
- 400
{
"status": "success",
"data": <UserData>
}
{
"error": "Invalid request"
}
UserData example
{
"username": "itenerai",
"displayName": "iTenerai",
"bio": "hi there!",
"pronouns": "she/her",
"picture": "imageLinkHere",
"banner": "imageLinkHere",
"status": "crafting and mining",
"level": 68,
"xp": 420,
"verified": true,
"subscription": "auronita"
}
Inventory
Endpoints for the current user's inventory. Manipulating and retrieving.
Retrieving items
GET /user/getInventory
Retrieves the list of items in the current user's inventory
Response
- Success
- Error
{
"status": "success",
"data": <InventoryData>
}
{
"status": "error",
"message": "Error message here"
}
InventoryData example
{
"id": "1000users",
"title": "1000 Users Celebration",
"type": 0,
"format": "png",
"equipped": false
},
{
"id": "1000users",
"title": "1000 Users Celebration",
"type": 0,
"format": "png",
"equipped": false
}
Equipping items
POST /user/equipItem
Equips the specified item for the user
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
itemId | string | ID of the item to be equipped |
Unequipping items
POST /user/unequipItem
Unequips the specified item for the user
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
itemId | string | ID of the item to be unequipped |
User interactions
Following
Send a signal to follow, or unfollow if already following, a user
POST /user/follow
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
followed | string | Username of the user to follow |
Notifications
Getting unread notifications
GET /user/getUnreadNotifications
Retrieves the currently unread notifications for the user
Update notification preference
POST /user/updateNotificationPreference
Toggle post notifications for a followed user
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
user | string | Followed user |
preference | bit | Whether to enable post notifications |
Tokens & Authentication
Invalidating a token
Each time a user logs in, a new token is created for their account. You can invalidate the current user's token by value or id.
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
?token | string | Token to be invalidated |
?tokenId | int | ID of the token to be invalidated |
At least one parameter must be specified