Getting started
An easy way to Integrate Gympass Booking API.
Installation
The Gympass PHP SDK can be installed with Composer. Run this command:
composer require vitorbritto/gympass-sdk-php
Usage
Authentication
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);
Class Reference
List of Controllers
ClassesController
Get singleton instance
The singleton instance of the ClassesController
class can be accessed from the API Client.
$classes = $client->getClasses();
create
Creates a list of classes on a given gym.
function create(
$gymId,
$payload)
Parameters
Parameter | Tags | Description |
---|---|---|
gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
payload | Required |
Payload for creating classes. |
Example Usage
$gymId = '1';
$payload = new Classes();
$result = $classes->create($gymId, $payload);
mlist
Get a list of classes on a given gym.
function mlist($gymId)
Parameters
Parameter | Tags | Description |
---|---|---|
gymId | Required DefaultValue |
The identifier of the gym at Gympass. Provided by Gympass. |
Example Usage
$gymId = '1';
$result = $classes->mlist($gymId);
getView
TODO: Add a method description
function getView(
$gymId,
$classId)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$result = $classes->getView($gymId, $classId);
update
TODO: Add a method description
function update(
$gymId,
$classId,
$payload)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$payload = new MClass();
$result = $classes->update($gymId, $classId, $payload);
SlotsController
Get singleton instance
The singleton instance of the SlotsController
class can be accessed from the API Client.
$slots = $client->getSlots();
create
TODO: Add a method description
function create(
$gymId,
$classId,
$payload)
Parameters
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 |
Example Usage
$gymId = '1';
$classId = '1';
$payload = new Slot();
$result = $slots->create($gymId, $classId, $payload);
getView
TODO: Add a method description
function getView(
$gymId,
$classId,
$slotId)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$slotId = '1';
$result = $slots->getView($gymId, $classId, $slotId);
mlist
TODO: Add a method description
function mlist(
$gymId,
$classId,
$from,
$to)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$from = 'From';
$to = 'To';
$result = $slots->mlist($gymId, $classId, $from, $to);
delete
TODO: Add a method description
function delete(
$gymId,
$classId,
$slotId)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$slotId = '1';
$slots->delete($gymId, $classId, $slotId);
createPatch
TODO: Add a method description
function createPatch(
$gymId,
$classId,
$slotId,
$payload)
Parameters
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. |
Example Usage
$gymId = '1';
$classId = '1';
$slotId = '1';
$payload = new SlotLimits();
$result = $slots->createPatch($gymId, $classId, $slotId, $payload);
update
TODO: Add a method description
function update($payload)
Parameters
Parameter | Tags | Description |
---|---|---|
payload | Required |
Payload for creating a slot. |
Example Usage
$payload = new Slot();
$result = $slots->update($payload);
BookingsController
Get singleton instance
The singleton instance of the BookingsController
class can be accessed from the API Client.
$bookings = $client->getBookings();
update
TODO: Add a method description
function update(
$gymId,
$bookingNumber,
$payload)
Parameters
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. |
Example Usage
$gymId = '1';
$bookingNumber = '1';
$payload = new Booking();
$result = $bookings->update($gymId, $bookingNumber, $payload);