-
Notifications
You must be signed in to change notification settings - Fork 2
1.4 Me
nitsuga5124 edited this page Feb 26, 2021
·
4 revisions
GET - /me
Gets the current user information. Requires either a valid session cookie or a token in the Authorization header.
Content-Type: application/json
// Always Returned:
roles: UnsignedInt, // See bitflag after
user_id: UnsignedInt, // Discord user ID
user_id_string: String, // JS pls...
is_banned: Boolean, // If the user is banned from uploading or not.
token: String, // The authorization token
discord: UserResponse, // OAuth2 response by discord, see @me endpoint of the discord API
mods: SearchModsResponse[], // An array of the same things returned by the search endpoint
teams: Map<String, UnsignedInt>, // Unsorted due to HashDos prevention.
// Will not be sent if missing
...Example:
{
"roles": 63,
"user_id": 182891574139682800,
"user_id_string": "182891574139682816",
"is_banned": false,
"token": "511N6mp2FhG1rHdZJHzG5OuTz1yYJ6",
"discord": {
"id": 182891574139682800,
"username": "nitsuga5124",
"avatar": "5ff1c404fdef2203c8eb9d33260983cb",
"discriminator": 2207,
"public_flags": 256,
"flags": 256,
"locale": "en-US",
"mfa_enabled": true,
"premium_type": null,
"email": "[email protected]"
},
"mods": [
{
"checksum": "533e5a14fc9dce7a13bda7e570b922c9253bd817c079e4f8abe9c5d5d0ea1d84",
"name": "testing",
"version": "2.0.0",
"description": "testing",
"verification": "None",
"downloads": 0,
"uploaded": "2020-12-29T04:15:45.647439+00:00"
}
]
}-
200Successfully retrieved user information. -
204Invalid login session or authorization token. -
400Discord session expired and the user needs to re-login.
OWNER = 0b00000001 ADMIN = 0b00000010 MOD = 0b00000100 VERIFYER = 0b00001000 MAPPER = 0b00010000 BOT = 0b00100000
curl -i "http://5124.mywire.org:1232/public_api/me" -H "Authorization: $TOKEN"