vitorbritto/gympass-sdk-php

An easy way to Integrate Gympass Booking API.

dev-master 2020-04-14 16:31 UTC

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

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

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

Example Usage

$gymId = '1';

$result = $classes->mlist($gymId);

Method: getView

TODO: Add a method description

function getView(
        $gymId,
        $classId)

Parameters

Example Usage

$gymId = '1';
$classId = '1';

$result = $classes->getView($gymId, $classId);

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

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

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

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

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

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

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

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

Example Usage

$gymId = '1';
$bookingNumber = '1';
$payload = new Booking();

$result = $bookings->update($gymId, $bookingNumber, $payload);

Back to Summary