You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 8 Next »
Logs the user in using its credentials
POST /login
Request
Method: POST
Only logged in: NO
Headers:
X-Requested-With
Parameters:
Response
Description
200
{ "success": 1, "message": "xxxxxxxx-1111-2222-3333-xxxxxxxxxxxx", "user_data": { "id": 4, "full_name": "John Doe", "username": "johndoe", "date_of_birth": "1988-12-05", "email": "johndoe@glitch.ro", "address": "-", "phone": "0700000000", "privilege": 5, "locale": "ro", "activation_token": null, "id_card_number": "1234", "club_id": null, "strikes": 2, "locked": null, "eula_accepted": "2018-05-17 18:01:04", "created_at": "2017-12-06 17:28:02", "updated_at": "2018-05-17 18:01:04", "banned_at": null, "sex": 1, "unique_number": "-", "id_document_serie": "-", "id_document_number": "-", "account_creation_by": 1, "trainer_id": 10, "is_trainer": 0 } }
{ "success": 0, "message": "Username / password invalid!" }
Success response
Base object:
User data object:
User privilege:
User locale:
User sex:
The way the account was created:
422
{ "success": 0 }
Error
Changes the logged in users' email address
POST /user/email
Account privilege restriction: Any logged in account
Only logged in: YES
{ "success": 1 }
403
Forbidden
{ "message": "The given data was invalid.", "errors": { "email": [ "The email has already been taken." ] } }
Changes the logged in users' address
POST /user/address
{ "message": "The given data was invalid.", "errors": { ... } }