Schedule

Schedule

Table of contents

Entry point

<instance-url>/api/<endpoint> example: https://trancend.dev/api/schedule

 

Getting clubs

Returns clubs data in a serialized format

GET /clubs

Request

 

Request

Request

Endpoint: /clubs

Method: GET

Headers:

Parameters:

Response

 

Response

Http Code

Response

Description

200

Success response
{ "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 property

Description

rows

Each club is a row

records

Number of total records

page

Current page

total

Total number of pages

Row object:

Object property

Description

id

The ID of the club

cell

Contains the club data

Cell object

Object property

Description

actions

The ID of the club. Used for front end rendering in some cases

name

Club name

max_book_per_day

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

max_waitlist

Maximum number of waitlist sports for each class

book_days_advance

Days in advance for booking a class

pos

Point of sell type

422

Error response
{ "success": 0 }

Error


 

Getting studios

Returns studios for a certain club

GET /studios

Request

 

Request

Request

Endpoint: /studios

Method: GET

Headers:

Parameters:

Response

 

Response

Http Code

Response

Description

200

Success response
{ "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 property

Description

rows

Each studio is a row

records

Number of total records

page

Current page

total

Total number of pages

Row object:

Object property

Description

id

The ID of the club

cell

Contains the club data

Cell object

Object property

Description

actions

The ID of the club. Used for front end rendering in some cases

name

Studio name

club_id

The club ID to which it belongs to

cycling_places

Number of cycling places

max_book_per_day

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

This overrides the club setting

max_waitlist

Maximum number of waitlist sports for each class

This overrides the club setting

book_days_advance

Days in advance for booking a class

This overrides the club setting

422

Error response
{ "success": 0 }

Error


 

Getting schedule data

Returns schedule data in a serialized format

GET /schedule

Request

 

Request

Request

Endpoint: /schedule

Method: GET

Headers:

Parameters:

Response

 

Response

Http Code

Response

Description

200

Success response
{ "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 property

Description

success

Indicates if the call was successful

days

Object containing each day (monday, tuesday, etc)

time

Array 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 property

Description

interval

The interval in which the class is taking place

name

Class name

date

Raw date

date_readable

Human readable date

duration

Duration of the class (in minutes)

studio

Studio name

time

Time when the class starts

club

Club name

trainer

Trainer name

can_confirm

Used by admins, indicates if bookings can be confirmed

id

class unique ID

can_edit

Used by admins, indicates if the class can be edited

can_book

Used by members, indicates if the class can still be booked

color

Background color of the class (used for schedule styling)

color_text

Color of the text of the class (used by schedule styling)

max_booking

Maximum number of participants

no_booked

Number of participants already booked

x_type

Indicates if the class is a real one or filler:

  • 1 - filler

  • 2 - real class

This is only used for styling the schedule

422

Error response
{ "success": 0 }

Error