CAPI - Class Booking

Introduction

This document guides the developer on how to use CAPI services to perform a Class Booking. ​ The reader is advised to familiarise himself/herself with the Class Booking process by reading CReME™ - Class Booking before this.

This document is divided into the following parts:

A1. Displaying the Class Calendar

Displaying the weekly calendar requires the programmer to populate the following:

A2. Populating the List of Class Titles
[
{ "ClassInstanceTitle": "FOD" },
{ "ClassInstanceTitle": "Kickboxing" },
{ "ClassInstanceTitle": "Lean Bodies" },
{ "ClassInstanceTitle": "RFC Dance Off" },
{ "ClassInstanceTitle": "RFC Pilates" },
{ "ClassInstanceTitle": "ROW out" },
{ "ClassInstanceTitle": "T3" },
{ "ClassInstanceTitle": "TRX Functional" },
{ "ClassInstanceTitle": "TRX Strength" },
{ "ClassInstanceTitle": "TRX Yoga" },
{ "ClassInstanceTitle": "TRX Yoga Flow" }
]
A3. Populating the List of Trainers
[
{
"MembershipNumber": "20012",
"GivenName": "Guru ",
"Surname": "Twoo",
"FullName": "Guru Twoo"
},
{
"MembershipNumber": "20060",
"GivenName": "Naomi ",
"Surname": "Bessant ",
"FullName": "Naomi Bessant "
},
{
"MembershipNumber": "40005",
"GivenName": "Guru ",
"Surname": "Wan ",
"FullName": "Guru Wan "
}
]
A4. Populating the Classes
[
{
"Id": 2881458,
"ClassInstanceTitle": "TRX Strength",
"ClassCategoryCode": "GX",
"Colour": "#FF8C00",
"ClassLayoutTitle": "4,4,4,4",
"ClassLocationTitle": "TRX Studio",
"ClubCode": "ECO",
"BitIdentifier": 1,
"LocationClubCode": "TRX Studio, ECO",
"StartTimeDayOfYear": 241,
"DaysAfterInputDate": 0,
"StartHour": 7,
"Description": "A total body, strength and conditioning workout that will have all shaking within 45 minutes! The best class to test your absolute strength paired with dynamic mobility and explosive movements to bring out the Athlete in you. Suitable from beginner to advanced athletes, this class will teach you basic TRX movements while allowing progression and regression within the same exercise.",
"StartTime": "Aug 29 2022 7:15AM",
"StartTimeYYMMDD": "2022-08-29",
"StartTimeYYMMDDTHHmmss": "2022-08-29T07:15:00",
"DurationInMinutes": 45,
"IconTitle": "TRX",
"FileName": "https://s3-ap-southeast-1.amazonaws.com/bucket.creme/icon/W1/trx.jpg",
"ClassInstructor": "Farouk Hashim ",
"Scheduler": "Naomi Bessant "
},
{
"Id": 2881463,
"ClassInstanceTitle": "T3",
"ClassCategoryCode": "GX",
"Colour": "#FCF3CF",
"ClassLayoutTitle": "Simple List 18",
"ClassLocationTitle": "Treads",
"ClubCode": "ECO",
"BitIdentifier": 1,
"LocationClubCode": "Treads, ECO",
"StartTimeDayOfYear": 241,
"DaysAfterInputDate": 0,
"StartHour": 17,
"Description": "Run. Resistance. Row. An interval training class which is designed to keep you moving from the treads to weights to rowing. Be ensured you’ll be working out to 45 minutes of heart stomping, athletic training regime moving to the beat of the hottest tracks!",
"StartTime": "Aug 29 2022 5:30PM",
"StartTimeYYMMDD": "2022-08-29",
"StartTimeYYMMDDTHHmmss": "2022-08-29T17:30:00",
"DurationInMinutes": 45,
"IconTitle": "RFC",
"FileName": "https://s3-ap-southeast-1.amazonaws.com/bucket.creme/icon/W1/RFC-logo-on-black.png",
"ClassInstructor": "William Sutton ",
"Scheduler": "Naomi Bessant "
},
]

In the example above,

Id is a unique identifier for ClassInstance.

ClassInstanceTitle is the title of ClassInstance. Only used by GX events. Blank for ST events.

ClassCategoryCode is can be "GX" (General Exercise) or "ST" (Self Training). In order to display only the GX events as shown in the calendar above, the ST events can be filtered out to show only the GX events.

Colour is the HTML code of this class in hexadecimal colour code.

ClassLayoutTitle=4,4,4,4 meaning the layout consists of 4 columns and 4 rows. A layout of 8,8,8 consists of 8 columns and 3 rows. Some are SimpleList.

ClassLocationTitle indicates where the Class will be held.

ClubCode indicates in which Club the Class will be held

BitIdentifier is a unique number denoting each Club. The section below explains how to use this parameter to filter the calendar according to Club.

LocationClubCode is a concatenation of ClassLocationTitle + ClubCode.

StartOfWeek is the first day of the week in which the class takes place. This is always a Sunday.

StartTimeDayOfYear is the day in the year that the class takes place.

DaysAfterInputDate is an integer value from 0 to 7. 0 denotes the date of the ClassInstance is the same as the InputDate. 1=the day after, 2=2 days after and so on.

StartHour is HH value of the time at which the class begins.

Description is multiline freetext describing the Class.

StartTime is the time when the class begins provided in 3 formats (StartTime, StartTimeYYMMDD, StartTimeYYMMDDTHHmmss)

DurationInMinutes is how long the class will run.

IconTitle is the name of the icon used to describe the class.

FileName is the URL of the icon.

ClassInstructor is the name of the trainer.

Scheduler is the person who created this class instance.

A5. Filtering by Club

When Populating the Classes, the server response returns the list of classes for all clubs. If the programmer would like to filter this list to display only some clubs, there are two ways to do this:

Filter by Club Code can be used when the programmer would like to display the classes from one club. He/she simple chooses the ClubCode. This can also be used when the user is given a list of ClubCodes to choose from.

Filter by BitIdentifier is more powerful because it can be used to filter a single club or multiple clubs using bitwise operators. An explanation of bitwise operators can be found at JavaScript Bitwise Operators.

Each Club is assigned a unique BitIdentifier. To obtain the list of Clubs and their BitIdentifiers, the following command is issued: