/gympass-sdk-php

:coffee: An easy way to integrate the Gympass Booking API.

Primary LanguagePHP

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

Class: ClassesController

Get singleton instance

The singleton instance of the ClassesController class can be accessed from the API Client.

$classes = $client->getClasses();

Method: 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);

Method: 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);

Method: 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);

Method: 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);

Back to List of Controllers

Class: SlotsController

Get singleton instance

The singleton instance of the SlotsController class can be accessed from the API Client.

$slots = $client->getSlots();

Method: 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);

Method: 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);

Method: 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);

Method: 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);

Method: 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);

Method: 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);

Back to List of Controllers

Class: BookingsController

Get singleton instance

The singleton instance of the BookingsController class can be accessed from the API Client.

$bookings = $client->getBookings();

Method: 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);

Back to Summary