New API available - faster and more powerful!

Check it out!
Perfect Gym api
Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2

Requests

This describes PerfectGym API requests basics.

Request parameters

You provide parameters to PerfectGym API with query string and body parameters.

The format for query string parameters is the full resource URL followed by a question mark, and the parameters.

Available query string and body parameters are described for each API endpoint.

Example

In this example, we fetch club (with id = 16) details. We request that returned data be in EN language. For detailed request description have a look here.

GET Clubs/Club
curl -i https://yourcompany.perfectgym.com/Api/Clubs/Club?clubId=16

Let's break down this request:

You can read it like so: from all clubs, select club with identifier of value 16

Filter and pagination parameters

We use query string parameters for filtering and pagination in the PerfectGym API. Available query string parameters are described for each API endpoint.

Example

In this example, we retrive classes availeble in club identified by id of value 1, that take place between 2016-01-01 and 2016-01-31

GET Classes/Classes
curl -i https://yourcompany.perfectgym.com/Api/Classes/Classes
    ?clubId=1
    &startDate=2016-01-01T00:00:00
    &endDate=2016-01-31T23:59:59

For details about pagination with page parameter go to Pagination with query string parameters

Timestamp parameter

Requests with timestamp parameter returns list of resources added or changed after point in time represented by timestamp value. Result is ordered by timestamp ascending. This let's you fetch only resources that changed since your last api call.

Example

In this example we fetch list of classes from the club with id of 1 and with timestamp value greater then 654321.

GET Classes/Classes
curl -i https://yourcompany.perfectgym.com/Api/Classes/Classes
    ?clubId=1
    &timestamp=654321

For details about pagination with timestamp parameter go to Pagination using timestamp

Perfect Gym api