Account management

Creation

Create a new account

POST https://api.naxalian.fr/accounts/create.php

Request Body

Name
Type
Description

nametag*

String

mail*

String

password*

String

Generate a token

POST https://api.naxalian.fr/accounts/login.php

Generates a valid token for 24 hours

Request Body

Name
Type
Description

userCredential*

String

It can be an id, a nametag or a mail

password*

String

Without hash or encoding

{
    "code" => 200,
    "userCredential" => {account id},
    "token" => {token}
}

Deletions

Delete an existing token

POST https://api.naxalian.fr/accounts/tokenDelete.php

Request Body

Name
Type
Description

token

String

A 64 characters long token

{
    "code" => 200,
    "message" => "Token deleted"
}

Delete an account

DELETE https://api.naxalian.fr/accounts/accountDelete.php

Request Body

Name
Type
Description

token*

String

userCredential*

String

It can be an id, a nametag or a mail

{
    "code" => 200,
    "message" => "Account deleted"
}

Informations

Get informations on a user's account from a token

GET https://api.naxalian.fr/accounts/getUserinfoFromToken.php

Request Body

Name
Type
Description

token*

String

{
    "code" => 200,
    "message" => "User info",
    "data" => [
        "id" => {info},
        "nametag" => {info},
        "mail" => {info},
        "rank" => {info},
        "created_at" => {info}
}

Update account's informations

POST https://api.naxalian.fr/accounts/updateUserinfo.php

Headers

Name
Type
Description

Authorization*

String

Your token

Request Body

Name
Type
Description

nametag

String

New nametag

mail

String

New mail

{
    "code" => 200,
    "message" => "Account edited"
}

Update password

POST https://api.naxalian.fr/accounts/updatePassword.php

Headers

Name
Type
Description

Authorization*

String

Your token

Request Body

Name
Type
Description

oldPassword*

Current password

newPassword*

String

New password

{
    "code": 200,
    "message": "Password edited"
}

Get all active sessions informations

GET https://api.naxalian.fr/accounts/getSessions.php

Headers

Name
Type
Description

Authorization*

String

Your token

Request Body

Name
Type
Description

String

{
        "code" => 200,
        "message" => "Sessions list",
        "data" => {session_list}
}

Last updated