Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Table of contents

Table of Contents





Log in

Logs the user in using its credentials

Info
iconfalse

Status
colourGreen
titlePOST
 /login


Request

Expand


Request

Endpoint: /login

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourRed
titleNO

Account privilege restriction: No restriction

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
username
Status
subtletrue
colourGreen
titleYES
StringUsername or email of the user
password
Status
subtletrue
colourGreen
titleYES
StringPassword of the account




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
 {
    "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,
		"has_scale_active": true
    }
}



Expand
titleError response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 0,
    "message": "Username / password invalid!"
}



Success response

Expand
titleObject 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)
has_scale_active

Indicates if the current user has an active scale / survey.

If true, the Get scale endpoint should be called.



Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
  "success": 0
}



Error





Get user data

Returns user data of the logged in user..

Info
iconfalse

Status
colourYellow
titleGET
 /user


Warning

Account privilege restriction: Any logged in account


Request

Expand


Request

Endpoint: /user

Method:

Status
colourYellow
titleGET

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction: Any privilege

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1,
    "user_data": {
        "id": 4,
        "full_name": "John Deux",
        "username": "johnd",
        "date_of_birth": "2017-12-05",
        "email": "johndeux@acme.com",
        "address": "-",
        "phone": "0712345678",
        "privilege": 5,
        "locale": "ro",
        "id_card_number": "7194",
        "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:33:07",
        "banned_at": null,
        "sex": 1,
        "unique_number": "-",
        "id_document_serie": "-",
        "id_document_number": "-",
        "account_creation_by": 1,
        "trainer_id": 10,
        "is_trainer": 0,
		"has_scale_active": true
    }
}



Success response

Expand
titleBase Object

Base object:

Object propertyDescription
successRepresents if the call was successful
user_dataRepresents the user data



Expand
titleUser_data object

User_data object:

Object propertyDescription
idInternal ID of the user
full_nameFull name of the user
usernameUsername
date_of_birthDate of birth
EmailEmail
addressAddress of the user
phonePhone of the user
privilege

User privilege:

  • 1 - Root
  • 2 - Club manager
  • 3 - Club administrator / reception
  • 4 - Trainer
  • 5 - Member
localeUser current locale
id_card_numberUser unique card number (or gatekeeper key)
club_idUser for club manager / club administrator to see to which club he belongs to
strikesHow many no shows he has
lockedShows if the account is locked by an admin
eula_acceptedDate and time for when the user accepted the club license agreement
created_atDate and time for when the user was created
updated_atDate and time for when the user was last updated
banned_atDate and time for when the user was banned for noshows
sex

Gender of the user

  • 1 - Male
  • 2 - Female
  • 3 - Other
unique_numberUser unique citizenship / passport number
id_document_serieUser unique citizenship / passport document serie
id_document_numberUser unique citizenship / passport document number
account_creation_by

Shows by whom the account was created:

  • 1 - Admin
  • 2 - Self signup
  • 3 - Invite
  • 4 - CSV import
trainer_idThe ID of the trainer which is assigned to him
is_trainerFlag showing if the user has access to trainer tools or not
has_scale_active

Indicates if the current user has an active scale / survey.

If true, the Get scale endpoint should be called.



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource





Change email address

Changes the logged in users' email address

Info
iconfalse

Status
colourGreen
titlePOST
 /user/email


Warning

Account privilege restriction: Any logged in account


Request

Expand


Request

Endpoint: /user/email

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction: Any privilege

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint



Parameters:

Expand


ParameterRequiredTypeDescription
email
Status
subtletrue
colourGreen
titleYES
StringNew email




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}



Error





Change address

Changes the logged in users' address

Info
iconfalse

Status
colourGreen
titlePOST
 /user/address


Warning

Account privilege restriction: Any logged in account


Request

Expand


Request

Endpoint: /user/address

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction: Any privilege

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint



Parameters:

Expand


ParameterRequiredTypeDescription
address
Status
subtletrue
colourGreen
titleYES
StringNew address




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}



Error





Change phone number

Changes the logged in users' phone number

Info
iconfalse

Status
colourGreen
titlePOST
 /user/phone


Warning

Account privilege restriction: Any logged in account


Request

Expand


Request

Endpoint: /user/phone

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction: Any privilege

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint



Parameters:

Expand


ParameterRequiredTypeDescription
phone
Status
subtletrue
colourGreen
titleYES
StringNew phone number




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}



Error





Change password

Changes the logged in users' phone number

Info
iconfalse

Status
colourGreen
titlePOST
 /user/password


Warning

Account privilege restriction: Any logged in account


Request

Expand


Request

Endpoint: /user/password

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourGreen
titleYES

Account privilege restriction: Any privilege

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest
X-Auth-TokenToken obtained from Login endpoint



Parameters:

Expand


ParameterRequiredTypeDescription
password
Status
subtletrue
colourGreen
titleYES
StringNew password
password_confirmation
Status
subtletrue
colourGreen
titleYES
StringNew password confirmation




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}



Error





Reset password

Sends the reset password link to the user email

Info
iconfalse

Status
colourGreen
titlePOST
 /reset_password


Request

Expand


Request

Endpoint: /reset_password

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourRed
titleNO

Account privilege restriction: No restriction

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
email
Status
subtletrue
colourGreen
titleYES
StringUser registered email
site_integration
Status
subtletrue
colourRed
titleNO
Integer

Sets if the link sent to reset the password should be on the gym's site or not.

Possible values:

  • 0 - Normal email
  • 1 - Email link sends to personalized web page on gym website


Info

The link to the custom page can be set by the root privileged user in the application settings page under the integrations tab.





Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}



Error





Reset password change (via token)

Changes the user password via the token gotten from email

Info
iconfalse

Status
colourGreen
titlePOST
 /reset_password_change


Request

Expand


Request

Endpoint: /reset_password_change

Method:

Status
colourGreen
titlePOST

Only logged in:

Status
colourRed
titleNO

Account privilege restriction: No restriction

Headers:

Expand


Header nameValue
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
key
Status
subtletrue
colourGreen
titleYES
StringToken got via email
password
Status
subtletrue
colourGreen
titleYES
StringNew password
password_confirmation
Status
subtletrue
colourGreen
titleYES
StringNew password confirmation




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand
titleSuccess response


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1
}



Success response

Expand
titleObject Description

Base object:

Object propertyDescription
successRepresents if the call was successful



Status
colourRed
title403


Code Block
Forbidden


User cannot access the resource

Status
colourRed
title422


Expand


Code Block
titleError response
linenumberstrue
{
    "message": "The given data was invalid.",
    "errors": {
        ...
    }
}



Error