Edit Users

All request on this page require the same header

Header authorization access_token

Edit User

Function that let you edit your own personal information like avatar (and potentially other values like name, quote, banner). Does not let you change values that would let you cheat like coins, xp...

Admins can edit anyone, other users can only edit themselves.

POST http://127.0.0.1/users/edit/:userId

Replace :userId by the id of a user like 63cf123e98f08f4f18493e8c

{
    "avatar" : "test"
}

Edit Permission Level

Only admins can change permissions levels

POST http://127.0.0.1/users/permission/edit/:userId
{
    "permission_level" : 5
}

10: admin, can do everything, including assigning permissions

5: game server, can give rewards, read/validate other users

1: regular user, some information about other users are hidden (such as email), cannot give rewards, can only edit his own information

0: deactivated user, use for banning users. Cannot do anything.

Change Password

Any user can only change their own password.

POST http://127.0.0.1/users/password/edit
{
    "password_previous": "test",
    "password_new": "12345"
}

Reset Password

Can be used as a forgotten password feature. Does not require an access token.

POST http://127.0.0.1/users/password/reset
{
    "email": "email@test.com"
}

A email will be sent with a recovery code if the user exists. You will need to setup your SMTP inside config.js to let your API send emails.

To confirm, another request must be called with the code

POST http://127.0.0.1/users/password/reset/confirm
{
    "email": "email@test.com",
    "code": "GVTNYKEA",
    "password": "123456"
}

Email is inputted again for verification purposes. The code is the one sent by email. And password is the new password you want to set so it can be anything.

Last updated