vitorbritto / gympass-sdk-php
An easy way to Integrate Gympass Booking API.
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- apimatic/jsonmapper: ~1.3.0
- mashape/unirest-php: ~3.0.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-15 02:19:33 UTC
README
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.
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
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
Example Usage
$gymId = '1'; $result = $classes->mlist($gymId);
getView
TODO: Add a method description
function getView( $gymId, $classId)
Parameters
Example Usage
$gymId = '1'; $classId = '1'; $result = $classes->getView($gymId, $classId);
update
TODO: Add a method description
function update( $gymId, $classId, $payload)
Parameters
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
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
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
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
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
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
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
Example Usage
$gymId = '1'; $bookingNumber = '1'; $payload = new Booking(); $result = $bookings->update($gymId, $bookingNumber, $payload);