Retrieve the Schedule
The scenario is as follows: an application intended for club members displays the weekly schedule.
Find this scenario in our Bruno collection
Save time in your implementation by observing the sequence of calls and retrieving requests directly from Bruno.
Before You Begin
Let’s make sure we’re using the same terminology.
Contact
This refers to the client who wants to make a booking. To avoid confusion with their status (prospect, client, former client, etc.), we’ll refer to them as "contact" in this document.
Activity
This refers to the type of exercises practiced during a fitness class.
Studio
This is the physical location where the class takes place. A club may have several studios, and each studio is linked to a club.
Understanding Calendars
A calendar groups multiple classes, and a class can belong to several calendars. These are different views of the available classes.
For example, a cycling class held in Studio 1 of the Paris 18th club with coach John will appear in the following calendars:
- the cycling calendar
- the Studio 1 calendar
- John’s calendar
Note: There is no calendar linked directly to the club. To get this view, you must query all the calendars of the club’s studios.
Querying Classes for a Time Period
Before making a booking, it’s common to display the list of scheduled classes for a given period. You’ll query a complete list or a partial view based on the desired calendars.
Make a GET request to the Resamania API as follows:
https://{api_base_url}/{client_token}/events?startedAt={started_at}&endedAt={ended_At}&calendars[]={calendar_id}Refer to the table below for request parameters:
| Parameter | Description |
|---|---|
api_base_url | The API URL you want to use. It varies depending on integration or production environments |
client_token | Each club chain has a Resamania identifier called client_token |
started_at | Start date and time (format YYYY-MM-ddTHH:mm:ss, e.g. 2019-09-30T00:00:00) |
ended_at | End date and time (same format, e.g. 2019-09-30T24:00:00) |
calendars[] | List of desired calendars. A calendar is identified by the textual ID of its resource. For example, for a coach: /{client_token}/coaches/{id} |
Getting Activities
When displaying the schedule, querying the activity directory is essential.
Make a GET request to the Resamania API as follows:
https://{api_base_url}/{client_token}/activities?archived=trueRefer to the table below for request parameters:
| Parameter | Description |
|---|---|
api_base_url | The API URL you want to use. It varies depending on integration or production environments |
client_token | Each club chain has a Resamania identifier called client_token |
archived | Includes archived activities (false by default) |
Getting Studios
Just like activities, the studio directory is a must-query.
Make a GET request to the Resamania API as follows:
https://{api_base_url}/{client_token}/studiosGetting Coaches
The final essential directory when querying calendars is the list of coaches.
Make a GET request to the Resamania API as follows:
https://{api_base_url}/{client_token}/coaches