Level System
Manage and retrieve user XP data in a level system for your Discord guild.
GET
Get User XP
https://yunite.xyz/api/v3/guild/{serverID}/levelsystem/user/{discordId}
- Request
- Response
Path Parameters
Name | Value type | Description |
---|---|---|
serverID | Guild ID Snowflake | The ID of the guild you want to access |
discordId | Discord User ID | The ID of the user whose XP you want to access |
- Schema
- Example
{ "type": "object", "properties": { "userId": { "type": "string", "value": "Discord User ID" }, "xp": { "type": "long", "value": "User's XP" } } }
{ "userId": "12345654321123432", "xp": 1500 }
PUT
Set User XP
https://yunite.xyz/api/v3/guild/{serverID}/levelsystem/user/{discordId}
Path ParametersName | Value type | Description |
---|---|---|
serverID | Guild ID Snowflake | The ID of the guild you want to access |
discordId | Discord User ID | The ID of the user whose XP you want to set |
- Schema
- Example
{ "type": "long", "value": "XP to set" }
2000
info
Use content type application/json
for the request body.
POST
Add User XP
https://yunite.xyz/api/v3/api/v3/guild/{serverID}/levelsystem/user/{discordId}/add
Path ParametersName | Value type | Description |
---|---|---|
serverID | Guild ID Snowflake | The ID of the guild you want to access |
discordId | Discord User ID | The ID of the user whose XP you want to add to |
- Schema
- Example
{ "type": "long", "value": "XP to add (can be negative to subtract)" }
500
info
Use content type application/json
for the request body.
tip
You can use negative values to subtract XP.
GET
Get Leaderboard
https://yunite.xyz/api/v3/api/v3/guild/{serverID}/levelsystem/leaderboard
- Request
- Response
Path Parameters
Name | Value type | Description |
---|---|---|
serverID | Guild ID Snowflake | The ID of the guild you want to access |
- Schema
- Example
{ "type": "array", "itemSchema": { "type": "object", "properties": { "userId": { "type": "string", "value": "Discord User ID" }, "xp": { "type": "long", "value": "User's XP" } } } }
[ { "userId": "12345654321123432", "xp": 1500 }, { "userId": "45678765456788432", "xp": 1200 } ]