Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of contents

Table of Contents

Info

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

Get member subscription history

Changes the logged in users' email address

Info
iconfalse
StatuscolourYellowtitleGET /user/history/subscriptions
Warning

Account privilege restriction:

  • Root
  • Club manager
  • Administrator / Reception
  • Member

Request

Expand

Request

Endpoint: /user/history/subscriptionsMethod: StatuscolourYellowtitleGET

Only logged in:

Status
colourGreen
titleYES

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

Headers:

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

Parameters:

ExpandParameterRequiredTypeDescriptionuser_id StatussubtletruecolourRedtitleNOString

User id for which to get the information

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

sidx StatussubtletruecolourRedtitleNO

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 StatussubtletruecolourRedtitleNO

Default: asc

String

Sort order:

  • asc- Ascending
  • desc - Descending
limit StatussubtletruecolourRedtitleNO

Default: 10

IntegerNumber of records to fetchpage StatussubtletruecolourRedtitleNO

Default: 1

IntegerPage numbersubscription_state StatussubtletruecolourRedtitleNOInteger

State of the subscription:

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

Default: false

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

Response

Expand

Response

Http Code

Response

Description

Status
colourBlue
title200

Expand Code Block
titleSuccess response
linenumberstrue
{ "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",


Table of contents

Table of Contents



Info

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




Get member subscription history

Gets the members' subscription history

Info
iconfalse

Status
colourYellow
titleGET
 /user/history/subscriptions


Warning

Account privilege restriction:

  • Root
  • Club manager
  • Administrator / Reception
  • Member


Request

Expand


Request

Endpoint: /user/history/subscriptions

Method:

Status
colourYellow
titleGET

Only logged in:

Status
colourGreen
titleYES

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

Headers:

Expand


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



Parameters:

Expand


ParameterRequiredTypeDescription
user_id
Status
subtletrue
colourRed
titleNO
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

Status
subtletrue
colourRed
titleNO

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

Status
subtletrue
colourRed
titleNO

Default: asc

String

Sort order:

  • asc- Ascending
  • desc - Descending
limit

Status
subtletrue
colourRed
titleNO

Default: 10

IntegerNumber of records to fetch
page

Status
subtletrue
colourRed
titleNO

Default: 1

IntegerPage number
subscription_state
Status
subtletrue
colourRed
titleNO
Integer

State of the subscription:

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

Status
subtletrue
colourRed
titleNO

Default: false

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




Response

Shows the status of the subscription:

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


    Response

    Http Code

    Response

    Description

    Status
    colourBlue
    title200


    Expand


    Code Block
    titleSuccess response
    linenumberstrue
     {
        "rows": [
            {
                "typeid": "Personal",
       6,
                "accesscell": "Best club (Toate)",{
                    "access_timeactions": "07:00 - 23:59"6,
                    "access_typename": "FullTest accesssubscription",
                    "checkinstype": "0 (0)Corporate",
                    "entrancesaccess": "0Best club (0Toate)",
                    "invitesaccess_time": "0 (0)07:00 - 23:59",
                    "availability": "02/01/2018 - 04/02/2018",access_type": "Full access",
                    "checkins": "0 (0)",
                         "is_active": 1
                }
            }
        ],
        "records": 2,
        "page": 1,
        "total": 1
    }

    Success response

    Expand
    titleBase object
    Object propertyDescription
    rowsEach club is a row
    recordsNumber of total records
    pageCurrent page
    totalTotal number of pages
    Expand
    titleRow object
    Object propertyDescription
    idThe ID of the subscription
    cellContains the subscription data
    Expand
    titleCell 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
    "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

    Expand
    titleBase object


    Object propertyDescription
    rowsEach club is a row
    recordsNumber of total records
    pageCurrent page
    totalTotal number of pages





    Expand
    titleRow object


    Object propertyDescription
    idThe ID of the subscription
    cellContains the subscription data






    Expand
    titleCell 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



    Status
    colourRed
    title422


    Expand


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



    Error





    Get member booking history

    Gets the members' booking history

    Info
    iconfalse

    Status
    colourYellow
    titleGET
     /user/history/bookings


    Warning

    Account privilege restriction:

    • Root
    • Club manager
    • Administrator / Reception
    • Member


    Request

    Expand


    Request

    Endpoint: /user/history/bookings

    Method:

    Status
    colourYellow
    titleGET

    Only logged in:

    Status
    colourGreen
    titleYES

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

    Headers:

    Expand


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



    Parameters:

    Expand


    ParameterRequiredTypeDescription
    user_id
    Status
    subtletrue
    colourRed
    titleNO
    String

    User id for which to get the information

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

    status
    Status
    subtletrue
    colourRed
    titleNO
    Integer

    Status of the booking:

    • 1 - Active
    • 2 - Show up
    • 3 - Waitlist
    • 4 - No show
    studio_id
    Status
    subtletrue
    colourRed
    titleNO
    IntegerID of the studio (obtained via the Schedule API)
    club_id
    Status
    subtletrue
    colourRed
    titleNO
    IntegerID of the club (obtained via the Schedule API)
    date_from
    Status
    subtletrue
    colourRed
    titleNO
    String

    Date from which to get the records

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

    date_to
    Status
    subtletrue
    colourRed
    titleNO
    String

    Date to which to get the records

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

    sidx

    Status
    subtletrue
    colourRed
    titleNO

    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

    Status
    subtletrue
    colourRed
    titleNO

    Default: asc

    String

    Sort order:

    • asc- Ascending
    • desc - Descending
    limit

    Status
    subtletrue
    colourRed
    titleNO

    Default: 10

    IntegerNumber of records to fetch
    page

    Status
    subtletrue
    colourRed
    titleNO

    Default: 1

    IntegerPage number
    subscription_state
    Status
    subtletrue
    colourRed
    titleNO
    Integer

    State of the subscription:

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

    Status
    subtletrue
    colourRed
    titleNO

    Default: false

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




    Response

    Expand


    Response

    Http Code

    Response

    Description

    Status
    colourBlue
    title200


    Expand


    Code Block
    titleSuccess response
    linenumberstrue
     {
        "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

    Expand
    titleBase object


    Object propertyDescription
    rowsEach club is a row
    recordsNumber of total records
    pageCurrent page
    totalTotal number of pages





    Expand
    titleRow object


    Object propertyDescription
    idThe ID of the subscription
    cellContains the subscription data






    Expand
    titleCell 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



    Status
    colourRed
    title422


    Expand


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



    Error





    Getting group class info for booking

    Gets the group class info along with the available places and subscriptions

    Info
    iconfalse

    Status
    colourYellow
    titleGET
     /group_class/book/{class_id}


    Warning

    Account privilege restriction:

    • Club manager
    • Administrator / Reception
    • Member


    Request

    Expand


    Request

    Endpoint: /group_class/book/{class_id}

    Method:

    Status
    colourYellow
    titleGET

    Only logged in:

    Status
    colourGreen
    titleYES

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

    Headers:

    Expand


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



    Parameters:

    Expand


    ParameterRequiredTypeDescription
    class_id
    Status
    subtletrue
    colourGreen
    titleYES
    IntegerClass ID obtained from the Schedule API.
    user_id
    Status
    subtletrue
    colourRed
    titleNO
    Integer

    User id for which to get the information

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




    Response

    Expand


    Response

    Http Code

    Response

    Description

    Status
    colourBlue
    title200


    Expand


    Code Block
    titleSuccess response
    linenumberstrue
     {
        "class_data": {
            "class_id": 48,
            "name": "Cycling",
            "trainer": "John Deux",
            "date": "17/05/2018 23:00:00",
            "studio": "new studio",
            "studio_pic": null,
            "club": "Best Club",
            "type": 2,
            "restrictions": "Full access / intrari",
            "can_book": true,
            "reason_book": ""
        },
        "subscriptions": [
            {
                "id": 6570,
                "subscription_id": 1,
                "user_id": 4,
                "start_date": "2018-05-16 00:00:00",
                "end_date": "2018-06-15 19:30:29",
                "initial_entrances": 0,
                "initial_invites": 0,
                "entrances": 0,
                "invites": 0,
                "created_at": "2018-05-17 19:30:29",
                "updated_at": "2018-05-17 19:30:29",
                "initial_checkins": 0,
                "checkins": 0,
                "corporate_id": null,
                "was_frozen": null,
                "reward_id": null,
                "status": 1,
                "type": 1,
                "club_id": 1,
                "studio_id": null,
                "min_hour": "07:00",
                "max_hour": "23:59",
                "name": "Test",
                "display": "Test (16/05/2018 - 15/06/2018)"
            }
        ],
        "places": {
            "1": "Bicicleta nr 1"
        }
    }



    Success response

    Expand
    titleBase object


    Object propertyDescription
    class_dataClass data
    subscriptionsArray of available subscriptions
    places

    Array of available places

    (can be null / empty if class type is 0)



    Expand
    titleclass_data object


    Object propertyDescription
    class_idThe ID of the class
    nameClass name
    trainerTrainer name
    dateClass date
    studioStudio name
    studio_pic

    Studio picture URL

    (used for choosing cycling places)

    clubClub name
    type

    Class type:

    • 0 - Normal class
    • 1 - Cycling
    • 2 - Kangoo jumps
    restrictionsClass booking restrictions
    can_bookIndicates if member can still book or not that class
    reason_bookShows the reason why the member CAN NOT book that class



    Expand
    titlesubscriptions object


    Object propertyDescription
    idID of the subscription relative to the user
    subscription_id

    Subscription base ID

    (ID from which the subscription was created)

    user_id

    User ID to which the subscription belongs to

    start_date

    Start date of the subscription

    end_date

    End date of the subscription

    initial_entrances

    Initial entrances on that subscription

    initial_invites

    Initial invites on that subscription

    entrances

    Remaining entrances on that subscription

    invites

    Remaining invites on that subscription

    created_atIndicates when the subscription was added to the user
    updated_atIndicates when the record was last updated
    initial_checkinsInitial checkins on that subscription
    checkinsRemaining checkins on that subscription
    corporate_idID of the corporation in case it's a corporate subscription
    was_frozenFlag indicating if the subscription was frozen before
    reward_idIndicates the ID of the reward in case it was generated from a reward code
    status

    Subscription status:

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

    Subscription type

    club_id

    The club ID for which the subscription has access to

    (null means global / all)

    studio_id

    The studio ID for which the subscription has access to

    (null means global / all)

    min_hourMinimum hour on which the subscription can be used
    max_hourMaximum hour on which the subscription can be used
    nameName of the subscription
    displayHuman readable subscription name containing availability



    Expand
    titleplaces object


    Object propertyDescription
    <id><name of the option>



    Status
    colourRed
    title422


    Expand


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



    Error





    Booking a class

    Saves a booking for the member

    Info
    iconfalse

    Status
    colourGreen
    titlePOST
     /group_class/book


    Warning

    Account privilege restriction:

    • Club manager
    • Administrator / Reception
    • Member


    Request

    Expand


    Request

    Endpoint: /group_class/book

    Method:

    Status
    colourGreen
    titlePOST

    Only logged in:

    Status
    colourGreen
    titleYES

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

    Headers:

    Expand


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



    Parameters:

    Expand


    ParameterRequiredTypeDescription
    class_id
    Status
    subtletrue
    colourGreen
    titleYES
    IntegerClass ID obtained from the Schedule API.
    place
    Status
    subtletrue
    colourRed
    titleNO
    Integer

    Place ID obtained from the Group class info API endpoint

    subscription_id
    Status
    subtletrue
    colourGreen
    titleYES
    IntegerSubscription ID obtained from the Group class info API endpoint




    Response

    Expand


    Response

    Http Code

    Response

    Description

    Status
    colourBlue
    title200


    Expand


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



    Success response

    Expand
    titleBase object


    Object propertyDescription
    successIndicates call status
    message

    String with message if success was 0

    Integer representing booking status (1 or 3) if success was 1



    Status
    colourRed
    title422


    Expand


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



    Error





    Canceling a class booking via API

    Deletes a booking via API call (no redirect)

    Info
    iconfalse

    Status
    colourYellow
    titleGET
     /book/cancel/{cancel_code}?ajax=true


    Request

    Expand


    Request

    Endpoint: /book/cancel/{cancel_code}?ajax=true

    Method:

    Status
    colourYellow
    titleGET

    Only logged in:

    Status
    colourRed
    titleNO

    Account privilege restriction: none

    Headers:

    Expand


    Header nameValue
    X-Requested-With
    XMLHttpRequest



    Parameters:

    Expand


    ParameterRequiredTypeDescription
    cancel_code
    Status
    subtletrue
    colourGreen
    titleYES
    StringCancel token obtained from the booking history endpoint




    Response

    Expand


    Response

    Http Code

    Response

    Description

    Status
    colourBlue
    title200


    Expand


    Code Block
    titleSuccess response
    linenumberstrue
    {
    	"success":1,
    	"message":"Rezervarea a fost anulata cu succes!"
    }



    Success response

    Expand
    titleBase object


    Object propertyDescription
    successIndicates call status
    message

    Message to be displayed to the user



    Status
    colourRed
    title422


    Expand


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



    Error