Versions Compared

Key

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


Table of contents

Table of Contents



Getting clubs

Returns clubs data in a serialized format

Info
iconfalse

Status
colourYellow
titleGET
 /clubs


Request

Expand


Request

Endpoint: /clubs

Method:

Status
colourYellow
titleGET

Headers:

Expand


Header nameValue
Content-Type
multipart/form-data
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
name
Status
subtletrue
colourRed
titleNO
StringUsed for searching for a specific club
limit
Status
subtletrue
colourRed
titleNO
IntegerNumber of records to be returned (default: 10)
page
Status
subtletrue
colourRed
titleNO
IntegerPage for records (default: 1)
no_limit
Status
subtletrue
colourRed
titleNO
BooleanIgnore limit and page and return all records (default: false)




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand


Code Block
titleSuccess response
linenumberstrue
 {
    "rows": [
        {
            "id": 1,
            "cell": {
                "actions": 1,
                "name": "Club 1",
                "max_book_per_day": 5,
                "max_waitlist": 10,
                "book_days_advance": 7,
                "pos": "Manual (fara casa de marcat)"
            }
        }
    ],
    "records": 1,
    "page": 1,
    "total": 1
}



Success response

Object description:

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 club
cellContains the club data

Cell object

Object propertyDescription
actionsThe ID of the club. Used for front end rendering in some cases
nameClub name
max_book_per_dayMaximum number of classes that can be booked by one person in that day
max_waitlistMaximum number of waitlist sports for each class
book_days_advanceDays in advance for booking a class
posPoint of sell type


Status
colourRed
title422


Expand


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



Error





Getting studios

Returns studios for a certain club

Info
iconfalse

Status
colourYellow
titleGET
 /studios


Request

Expand


Request

Endpoint: /studios

Method:

Status
colourYellow
titleGET

Headers:

Expand


Header nameValue
Content-Type
multipart/form-data
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
name
Status
subtletrue
colourRed
titleNO
StringUsed for searching for a specific club
club_id
Status
subtletrue
colourRed
titleNO
IntegerID of the belonging club (got from /clubs endpoint)
limit
Status
subtletrue
colourRed
titleNO
IntegerNumber of records to be returned (default: 10)
page
Status
subtletrue
colourRed
titleNO
IntegerPage for records (default: 1)
no_limit
Status
subtletrue
colourRed
titleNO
BooleanIgnore limit and page and return all records (default: false)




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand


Code Block
titleSuccess response
linenumberstrue
 {
    "rows": [
        {
            "id": 1,
            "cell": {
                "actions": 1,
                "name": "Cycling",
                "club_id": 1,
                "cycling_places": 10,
                "max_book_per_day": 5,
                "max_waitlist": 10,
                "book_days_advance": 2
            }
        }
    ],
    "records": 1,
    "page": 1,
    "total": 1
}



Success response

Object description:

Base object:

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

Row object:

Object propertyDescription
idThe ID of the club
cellContains the club data

Cell object

Object propertyDescription
actionsThe ID of the club. Used for front end rendering in some cases
nameStudio name
club_idThe club ID to which it belongs to
cycling_placesNumber of cycling places
max_book_per_day

Maximum number of classes that can be booked by one person in that day

Warning

This overrides the club setting


max_waitlist

Maximum number of waitlist sports for each class

Warning

This overrides the club setting


book_days_advance

Days in advance for booking a class

Warning

This overrides the club setting



Status
colourRed
title422


Expand


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



Error





Getting schedule data

Returns schedule data in a serialized format

Info
iconfalse

Status
colourYellow
titleGET
 /schedule


Request

Expand


Request

Endpoint: /schedule

Method:

Status
colourYellow
titleGET

Headers:

Expand


Header nameValue
Content-Type
multipart/form-data
X-Requested-With
XMLHttpRequest



Parameters:

Expand


ParameterRequiredTypeDescription
start_date
Status
subtletrue
colourRed
titleNO
DateDate of format "Y-m-d" (example: 2018-01-30)
end_date
Status
subtletrue
colourRed
titleNO
DateDate of format "Y-m-d" (example: 2018-01-30)
club_id
Status
subtletrue
colourRed
titleNO
IntegerID of club
studio_id
Status
subtletrue
colourRed
titleNO
IntegerID of studio




Response

Expand


Response

Http Code

Response

Description

Status
colourBlue
title200


Expand


Code Block
titleSuccess response
linenumberstrue
{
    "success": 1,
    "days": {
        "monday": {
            "classes": {
                "21:00": [
                    {
                        "interval": "21:00 - 21:20",
                        "name": "Test clasa",
                        "date": "2018-02-26 21:00",
                        "date_readable": "26/02/2018",
                        "duration": 20,
                        "studio": "Cycling",
                        "time": "21:00",
                        "club": "Club 1",
                        "trainer": "trainer",
                        "can_confirm": true,
                        "id": 2,
                        "can_edit": false,
                        "can_book": false,
                        "color": "#222222",
                        "color_text": "#ffffff",
                        "max_booking": 30,
                        "no_booked": 0,
                        "x_type": 2
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "tuesday": {
            "classes": {
                "17:00": [
                    {
                        "interval": "17:00 - 17:23",
                        "name": "Clasa",
                        "date": "2018-02-27 17:00",
                        "date_readable": "27/02/2018",
                        "duration": 23,
                        "studio": "Cycling",
                        "time": "17:00",
                        "club": "Club 1",
                        "trainer": "trainer",
                        "can_confirm": false,
                        "id": 3,
                        "can_edit": false,
                        "can_book": false,
                        "color": "#222222",
                        "color_text": "#ffffff",
                        "max_booking": 12,
                        "no_booked": 0,
                        "x_type": 2
                    }
                ],
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "wednesday": {
            "classes": {
                "12:00": [
                    {
                        "interval": "12:00 - 12:20",
                        "name": "Clasa waitlist",
                        "date": "2018-02-28 12:00",
                        "date_readable": "28/02/2018",
                        "duration": 20,
                        "studio": "Cycling",
                        "time": "12:00",
                        "club": "Club 1",
                        "trainer": "trainer",
                        "can_confirm": false,
                        "id": 4,
                        "can_edit": false,
                        "can_book": false,
                        "color": "#222222",
                        "color_text": "#ffffff",
                        "max_booking": 32,
                        "no_booked": 0,
                        "x_type": 2
                    }
                ],
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "thursday": {
            "classes": {
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "friday": {
            "classes": {
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "saturday": {
            "classes": {
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        },
        "sunday": {
            "classes": {
                "21:00": [
                    {
                        "name": "filler",
                        "time": "21:00",
                        "x_type": 1
                    }
                ],
                "17:00": [
                    {
                        "name": "filler",
                        "time": "17:00",
                        "x_type": 1
                    }
                ],
                "12:00": [
                    {
                        "name": "filler",
                        "time": "12:00",
                        "x_type": 1
                    }
                ]
            }
        }
    },
    "time": [
        {
            "time": "21:00"
        },
        {
            "time": "17:00"
        },
        {
            "time": "12:00"
        }
    ]
}



Success response

Object description:

Base object:

Object propertyDescription
successIndicates if the call was successful
daysObject containing each day (monday, tuesday, etc)
timeArray of times which are used in that interval

Classes object:

Array which has as keys the time and as values an array of class description objects

Object propertyDescription
intervalThe interval in which the class is taking place
nameClass name
dateRaw date
date_readableHuman readable date
durationDuration of the class (in minutes)
studioStudio name
timeTime when the class starts
clubClub name
trainerTrainer name
can_confirmUsed by admins, indicates if bookings can be confirmed
idclass unique ID
can_editUsed by admins, indicates if the class can be edited
can_bookUsed by members, indicates if the class can still be booked
colorBackground color of the class (used for schedule styling)
color_textColor of the text of the class (used by schedule styling)
max_bookingMaximum number of participants
no_bookedNumber of participants already booked
x_type

Indicates if the class is a real one or filler:

  • 1 - filler
  • 2 - real class
Info

This is only used for styling the schedule



Status
colourRed
title422


Expand


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



Error