An easy way to Integrate Gympass Booking API.
The Gympass PHP SDK can be installed with Composer. Run this command:
composer require vitorbritto/gympass-sdk-php
In order to setup authentication and initialization of the API client, you need the following information.
| Parameter | Description |
|---|---|
| oAuthAccessToken | OAuth 2.0 Access Token |
API client can be initialized as following.
$oAuthAccessToken = 'oAuthAccessToken'; // OAuth 2.0 Access Token
$client = new GympassAPILib\GympassAPIClient($oAuthAccessToken);The singleton instance of the ClassesController class can be accessed from the API Client.
$classes = $client->getClasses();Creates a list of classes on a given gym.
function create(
$gymId,
$payload)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| payload | Required |
Payload for creating classes. |
$gymId = '1';
$payload = new Classes();
$result = $classes->create($gymId, $payload);Get a list of classes on a given gym.
function mlist($gymId)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
$gymId = '1';
$result = $classes->mlist($gymId);TODO: Add a method description
function getView(
$gymId,
$classId)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
$gymId = '1';
$classId = '1';
$result = $classes->getView($gymId, $classId);TODO: Add a method description
function update(
$gymId,
$classId,
$payload)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| payload | Required |
Payload for updating a class. |
$gymId = '1';
$classId = '1';
$payload = new MClass();
$result = $classes->update($gymId, $classId, $payload);The singleton instance of the SlotsController class can be accessed from the API Client.
$slots = $client->getSlots();TODO: Add a method description
function create(
$gymId,
$classId,
$payload)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| payload | Required |
Payload for creating a class |
$gymId = '1';
$classId = '1';
$payload = new Slot();
$result = $slots->create($gymId, $classId, $payload);TODO: Add a method description
function getView(
$gymId,
$classId,
$slotId)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| slotId | Required DefaultValue |
The identifier of the Slot at Gympass. Returned when create a Slot. |
$gymId = '1';
$classId = '1';
$slotId = '1';
$result = $slots->getView($gymId, $classId, $slotId);TODO: Add a method description
function mlist(
$gymId,
$classId,
$from,
$to)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| from | Required |
timezoned date/time to start find slots. It should be entered based on the location of the gym. |
| to | Required |
timezoned date/time to start find slots. It should be entered based on the location of the gym. |
$gymId = '1';
$classId = '1';
$from = 'From';
$to = 'To';
$result = $slots->mlist($gymId, $classId, $from, $to);TODO: Add a method description
function delete(
$gymId,
$classId,
$slotId)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| slotId | Required DefaultValue |
The identifier of the Slot at Gympass. Returned when create a Slot. |
$gymId = '1';
$classId = '1';
$slotId = '1';
$slots->delete($gymId, $classId, $slotId);TODO: Add a method description
function createPatch(
$gymId,
$classId,
$slotId,
$payload)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| classId | Required DefaultValue |
The identifier of the class at Gympass. Returned when create a Class. |
| slotId | Required DefaultValue |
The identifier of the Slot at Gympass. Returned when create a Slot. |
| payload | Required |
Payload for updating slot limits. |
$gymId = '1';
$classId = '1';
$slotId = '1';
$payload = new SlotLimits();
$result = $slots->createPatch($gymId, $classId, $slotId, $payload);TODO: Add a method description
function update($payload)| Parameter | Tags | Description |
|---|---|---|
| payload | Required |
Payload for creating a slot. |
$payload = new Slot();
$result = $slots->update($payload);The singleton instance of the BookingsController class can be accessed from the API Client.
$bookings = $client->getBookings();TODO: Add a method description
function update(
$gymId,
$bookingNumber,
$payload)| Parameter | Tags | Description |
|---|---|---|
| gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
| bookingNumber | Required DefaultValue |
The booking identifier at Gympass. Returned when create a Boooking. |
| payload | Required |
Payload for updating a booking. |
$gymId = '1';
$bookingNumber = '1';
$payload = new Booking();
$result = $bookings->update($gymId, $bookingNumber, $payload);
