Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Table of contents




Log in

Logs the user in using its credentials

POST /login

Request

 Click here to expand...


Request

Endpoint: /login

Method: POST

Only logged in: NO

Account privilege restriction: No restriction

Headers:

 Click here to expand...
Header nameValue
X-Requested-With
XMLHttpRequest

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
username
YES
StringUsername or email of the user
passwordYESStringPassword of the account

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Success response
Success response
 {
    "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
    }
}
 Error response
Success response
{
    "success": 0,
    "message": "Username / password invalid!"
}

Success response

 Object Description

Base object:

Object propertyDescription
successRepresents if the login was successful
messageLogin token used for logged in API calls / error message
user_dataUser data object

User data object:

Object propertyDescription
idInternal ID of the user
full_nameUser full name
usernameUser username
date_of_birthUser date of birth (Y-m-d format)
emailUser email
addressUser address
phoneUser phone number
privilege

User privilege:

  • 1 - Root
  • 2 - Club manager
  • 3 - Administrator / reception
  • 4 - Trainer
  • 5 - Member
locale

User locale:

  • ro - Romanian
  • en - English
activation_tokenInternal usage - will ALWAYS be null
id_card_numberCheck-in number for gatekeeper
club_idUsed for club managers and administrators to indicate the club they belong to. Otherwise it will be null
strikesHow many no shows it has at that moment that will be counted towards ban
lockedIndicates if the account was banned or not - will always be null
eula_acceptedIndicates the date and time when the user accepted the license agreement.
created_atDate and time when the user was created at
updated_atDate and time when the user was last updated at
banned_atDate and time when the user was banned due to too many no-shows. Null if not banned.
sex

User sex:

  • 1 - Male
  • 2 - Female
  • 3 - Other
unique_numberUser ID number from personal citizenship ID card
id_document_serieUser personal citizenship ID card document serie
id_document_numberUser personal citizenship ID card document number
account_creation_by

The way the account was created:

  • 1 - Admin
  • 2 - Self signup
  • 3 - Invite
  • 4 - CSV Import
trainer_idTrainer assigned to the user
is_trainerIndicates if the user is a trainer (used to override manager and admin privilege in case they are also trainers)


422

 Click here to expand...
Error response
{
  "success": 0
}

Error



Get user data

Returns user data of the logged in user..

GET /user

Account privilege restriction: Any logged in account




Change email address

Changes the logged in users' email address

POST /user/email

Account privilege restriction: Any logged in account

Request

 Click here to expand...


Request

Endpoint: /user/email

Method: POST

Only logged in: YES

Account privilege restriction: Any privilege

Headers:

 Click here to expand...
Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
email
YES
StringNew email

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Success response
Success response
{
    "success": 1
}

Success response

 Object Description

Base object:

Object propertyDescription
successRepresents if the call was successful

403

Forbidden
User cannot access the resource

422

 Click here to expand...
Error response
{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}

Error



Change address

Changes the logged in users' address

POST /user/address

Account privilege restriction: Any logged in account

Request

 Click here to expand...


Request

Endpoint: /user/address

Method: POST

Only logged in: YES

Account privilege restriction: Any privilege

Headers:

 Click here to expand...
Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
address
YES
StringNew address

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Success response
Success response
{
    "success": 1
}

Success response

 Object Description

Base object:

Object propertyDescription
successRepresents if the call was successful

403

Forbidden
User cannot access the resource

422

 Click here to expand...
Error response
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}

Error



Change phone number

Changes the logged in users' phone number

POST /user/phone

Account privilege restriction: Any logged in account

Request

 Click here to expand...


Request

Endpoint: /user/phone

Method: POST

Only logged in: YES

Account privilege restriction: Any privilege

Headers:

 Click here to expand...
Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
phone
YES
StringNew phone number

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Success response
Success response
{
    "success": 1
}

Success response

 Object Description

Base object:

Object propertyDescription
successRepresents if the call was successful

403

Forbidden
User cannot access the resource

422

 Click here to expand...
Error response
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}

Error



Change password

Changes the logged in users' phone number

POST /user/password

Account privilege restriction: Any logged in account

Request

 Click here to expand...


Request

Endpoint: /user/password

Method: POST

Only logged in: YES

Account privilege restriction: Any privilege

Headers:

 Click here to expand...
Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
password
YES
StringNew password
password_confirmationYESStringNew password confirmation

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Success response
Success response
{
    "success": 1
}

Success response

 Object Description

Base object:

Object propertyDescription
successRepresents if the call was successful

403

Forbidden
User cannot access the resource

422

 Click here to expand...
Error response
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}

Error

  • No labels