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

Before using this, please refer to Account API functions for login and API explanations.



Get member subscription history

Gets the members' subscription history

GET /user/history/subscriptions

Account privilege restriction:

  • Root
  • Club manager
  • Administrator / Reception
  • Member

Request

 Click here to expand...


Request

Endpoint: /user/history/subscriptions

Method: GET

Only logged in: YES

Account privilege restriction:
  • Root
  • Club manager
  • Administrator / Reception
  • Member

Headers:

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

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
user_id
NO
String

User id for which to get the information

Ignored if privilege is member and will only return data for current logged in member

sidx

NO

Default: name

String

Sort index for which to sort the records:

  • name - Name of the subscription
  • start_date - Subscription start date
  • end_date - Subscription end date
  • price - Subscription price
  • type - Subscription type
  • checkins - Subscription check-ins number
  • entrances - Subscription group class entrances number
  • invites - Subscription invites number
  • min_hour - Subscription minimum access hour
  • max_hour - Subscription maximum access hour
  • limited_stock - Subscription limited stock
  • availability - Subscription availability
sord

NO

Default: asc

String

Sort order:

  • asc- Ascending
  • desc - Descending
limit

NO

Default: 10

IntegerNumber of records to fetch
page

NO

Default: 1

IntegerPage number
subscription_stateNOInteger

State of the subscription:

  • 0 - Expired
  • 1 - Available
  • 2 - Not started yet
no_limit

NO

Default: false

BooleanIf set, it will ignore limit and page parameters and will fetch ALL records

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Click here to expand...
Success response
 {
    "rows": [
        {
            "id": 6,
            "cell": {
                "actions": 6,
                "name": "Test subscription",
                "type": "Corporate",
                "access": "Best club (Toate)",
                "access_time": "07:00 - 23:59",
                "access_type": "Full access",
                "checkins": "0 (0)",
                "entrances": "0 (0)",
                "invites": "0 (0)",
                "availability": "05/01/2018 - 06/01/2018",
                "is_active": 0
            }
        },
        {
            "id": 10,
            "cell": {
                "actions": 10,
                "name": "Test",
                "type": "Personal",
                "access": "Best club (Toate)",
                "access_time": "07:00 - 23:59",
                "access_type": "Full access",
                "checkins": "0 (0)",
                "entrances": "0 (0)",
                "invites": "0 (0)",
                "availability": "02/01/2018 - 04/02/2018",
                "is_active": 1
            }
        }
    ],
    "records": 2,
    "page": 1,
    "total": 1
}

Success response

 Base object
Object propertyDescription
rowsEach club is a row
recordsNumber of total records
pageCurrent page
totalTotal number of pages
 Row object
Object propertyDescription
idThe ID of the subscription
cellContains the subscription data


 Cell object


Object propertyDescription
actionsThe ID of the subscriptions. Used for front end rendering in some cases
nameSubscription name
type

Type of the subscription:

  • Personal
  • Corporate
access

Where access is allowed:

<club name> (<studio>)

access_time

Time span when the subscription can be used:

<start time> - <end time>

access_type

Access type of the subscription:

  • Full access
  • Entrances
checkins

How many check-ins are left:

<left> (<initial>)

entrances

How many group class entrances are left:

<left> (<initial>)

invites

How many invites are left:

<left> (<initial>)

is_active

Shows the status of the subscription:

  • 0 - expired
  • 1 - active
  • 2 - Not started

422

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

Error



Get member booking history

Gets the members' booking history

GET /user/history/bookings

Account privilege restriction:

  • Root
  • Club manager
  • Administrator / Reception
  • Member

Request

 Click here to expand...


Request

Endpoint: /user/history/bookings

Method: GET

Only logged in: YES

Account privilege restriction:
  • Root
  • Club manager
  • Administrator / Reception
  • Member

Headers:

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

Parameters:

 Click here to expand...
ParameterRequiredTypeDescription
user_id
NO
String

User id for which to get the information

Ignored if privilege is member and will only return data for current logged in member

statusNOInteger

Status of the booking:

  • 1 - Active
  • 2 - Show up
  • 3 - Waitlist
  • 4 - No show
studio_idNOIntegerID of the studio (obtained via the Schedule API)
club_idNOIntegerID of the club (obtained via the Schedule API)
date_fromNOString

Date from which to get the records

Format: Y-m-d (e.g. 2018-01-05)

date_toNOString

Date to which to get the records

Format: Y-m-d (e.g. 2018-01-10)

sidx

NO

Default: full_name

String

Sort index for which to sort the records:

  • status - Status of the booking
  • full_name - Name of the person who books (used for manager / admin)
  • date - Date of the class for which the booking was made
  • name - Name of the class
  • trainer - Name of the trainer
  • club_studio - Sort by club then by studio name
sord

NO

Default: asc

String

Sort order:

  • asc- Ascending
  • desc - Descending
limit

NO

Default: 10

IntegerNumber of records to fetch
page

NO

Default: 1

IntegerPage number
subscription_stateNOInteger

State of the subscription:

  • 0 - Expired
  • 1 - Available
  • 2 - Not started yet
no_limit

NO

Default: false

BooleanIf set, it will ignore limit and page parameters and will fetch ALL records

Response

 Click here to expand...


Response

Http Code

Response

Description

200

 Click here to expand...
Success response
 {
    "rows": [
        {
            "id": 9,
            "cell": {
                "actions": 9,
                "name": "Pilates",
                "date": "16/01/2018 20:00",
                "club_studio": "Best club / Studio X",
                "trainer": "John Deux",
                "place": "-",
                "status": "Neprezentare",
                "status_code": 4,
                "cancel_code": "928ebbcc-0ad8-4bea-b4c2-35a04191bd16"
            }
        },
        {
            "id": 22,
            "cell": {
                "actions": 22,
                "name": "Aerobic",
                "date": "25/02/2018 18:00",
                "club_studio": "Best club / Studio X",
                "trainer": "John Deux",
                "place": "-",
                "status": "Activa",
                "status_code": 1,
                "cancel_code": "f25390be-fd3b-40a8-9cbf-9dc0e19b774d"
            }
        },
        {
            "id": 24,
            "cell": {
                "actions": 24,
                "name": "Kickboxing",
                "date": "24/02/2018 15:00",
                "club_studio": "Best club / Studio X",
                "trainer": "John Deux",
                "place": "-",
                "status": "Prezentare",
                "status_code": 2,
                "cancel_code": "edefdc23-004a-49e6-a7aa-30ac7ddf0da2"
            }
        }
    ],
    "records": 3,
    "page": 1,
    "total": 1
}

Success response

 Base object
Object propertyDescription
rowsEach club is a row
recordsNumber of total records
pageCurrent page
totalTotal number of pages
 Row object
Object propertyDescription
idThe ID of the subscription
cellContains the subscription data


 Cell object


Object propertyDescription
actionsThe ID of the subscriptions. Used for front end rendering in some cases
nameGroup class name
date

Date and time when the class will take place

club_studio

Club and studio where the class will take place

trainer

Trainer name

place

Place in studio

(used for classes like Kangoo Jumps or Cycling)

status

Status of the booking in human readable form

status_code

Status of the booking:

  • 1 - Active
  • 2 - Show up
  • 3 - Waitlist
  • 4 - No show
cancel_code

Code used to cancel the booking

422

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

Error

  • No labels