Perfect Gym api

Classes

Class represents fitness class conducted in your club.

Class properties

Class is described by the following properties

Name Type Description
classType Class type Class type.
instructor Instructor Instructor conducting class.
club Club Club class take place in.
startDate datetime Class start date and time.
endDate datetime Class end date and time.
attendeesCount int Number of users signed up for class.
attendeesLimit int Maximum number of attendees allowed to attend class. null if there is no limit.
clubZone string Name of club zone.
clubZoneMapUrl string Url to club zone map if defined, otherwise empty.
colorRGB string Representing the color set for class.
allowBookSeatNumber bool Is it allows to book a specific seat number.
id long Unique identifier of class.
timestamp long Timestamp. Indicates when resource was last modified.
isDeleted bool Indicates if resource is deleted.

List classes in a given timeframe alt text alt text

GET Classes/Classes

Returns paginated classes list.

Parameters

Name Type Description
clubId long Required. Club identifier. Request returns classes that take place in club identified by clubId.
startDate datetime Required. Start date. Request returns classes that starts leter then startDate.
endDate datetime Required. End date. Request returns classes that ends earlier then endtDate.
page int Page number, defaults to 1.

Example request

In this example we fetch first 100 classes in club with id = 2, that starts in december 2015

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Classes/Classes
        ?clubId=2
        &startDate=2015-12-01T00:00:00
        &endDate=2015-12-31T23:59:59

Example response

Status: 200 OK
{
  "elements": [
    {
      "classType": {
        "id": 1,
        "timestamp": 263952,
        "name": "Box",
        "photoUrl": "",
        "iconUrl": "",
        "description": "Box perfectly combines cardio and strength training under the guise of groove!",
        "rating": {
          "rating": 4.1,
          "votesCount": 1234,
          "rankingSort": 2.3
        },
        "category": {
          "id": 2,
          "category": "MIX",
          "imageUrl": "https://yourdomain.perfectgym.pl/Api/Files/Photo?xxxxxxxxx",
          "isDeleted": false,
          "isProductRequiredForBooking": false,
          "name": "Mix",
          "timestamp": 1223165441
        }
      },
      "instructor": {
        "id": 52,
        "timestamp": 376826,
        "firstName": "Agatha",
        "lastName": "Strickland",
        "displayName": "Agatha Strickland",
        "email": "a.strickland@cyberbotics.com",
        "photoUrl": "",
        "sex": "Female",
        "rating": {
          "rating": 4.7,
          "votesCount": 1234,
          "rankingSort": 3.3
        },
        "isActive": true,
        "isDeleted": false
      },
      "club": {
        "id": 2,
        "timestamp": 271990,
        "name": "Fibo Cyberbotics",
        "shortName": "Cyberbotics",
        "symbol": "FCBR",
        "type": "Normal",
        "openDate": "2015-01-01",
        "latitude": 52.51038,
        "longitude": 13.39763,
        "email": "club@cyberbotics.com",
        "phoneNumber": "+49 12 123 456 789",
        "timezone": "Central European Standard Time",
        "address": {
          "line1": "Leipziger Str. 46/47",
          "line2": "",
          "city": "Berlin",
          "postalCode": "10-117",
          "country": "Germany"
        },
        "isDeleted": false,
        "isHidden": false
      },
      "id": 1677,
      "timestamp": 254718,
      "isDeleted": false,
      "startDate": "2015-12-03T06:15:00",
      "endDate": "2015-12-03T07:15:00",
      "attendeesCount": 7,
      "attendeesLimit": 20,
      "clubZone": "Fitness",
      "clubZoneMapUrl": "https://yourdomain.perfectgym.pl/Api/Files/Photo?xxxxxxxxx",
      "allowBookSeatNumber": true
    }
  ]
}

List classes with timestamp alt text alt text

GET Classes/Classes

Returns paginated classes list.

Parameters

Name Type Description
clubId long Required. Club identifier. Request returns classes that take place in club identified by clubId.
timestamp long Timestamp. Request returns classes with timestamp grater then timestamp, defaults to 0.

Example request

In this example we fetch list of all classes in club with id = 2 and with timestamp greater then 254000

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Classes/Classes
        ?clubId=2
        &timestamp=254000

Example response

Status: 200 OK
{
  "elements": [
    {
      "classType": {
        "id": 1,
        "timestamp": 263952,
        "name": "Box",
        "photoUrl": "",
        "iconUrl": "",
        "description": "Box perfectly combines cardio and strength training under the guise of groove!",
        "rating": {
          "rating": 4.1,
          "votesCount": 1234,
          "rankingSort": 2.3
        },
        "category": {
          "id": 2,
          "category": "MIX",
          "imageUrl": "https://yourdomain.perfectgym.pl/Api/Files/Photo?xxxxxxxxx",
          "isDeleted": false,
          "isProductRequiredForBooking": false,
          "name": "Mix",
          "timestamp": 1223165441
        }
      },
      "instructor": {
        "id": 52,
        "timestamp": 376826,
        "firstName": "Agatha",
        "lastName": "Strickland",
        "displayName": "Agatha Strickland",
        "email": "a.strickland@cyberbotics.com",
        "photoUrl": "",
        "sex": "Female",
        "rating": {
          "rating": 4.7,
          "votesCount": 1234,
          "rankingSort": 3.3
        },
        "isActive": true,
        "isDeleted": false
      },
      "club": {
        "id": 2,
        "timestamp": 271990,
        "name": "Fibo Cyberbotics",
        "shortName": "Cyberbotics",
        "symbol": "FCBR",
        "type": "Normal",
        "openDate": "2015-01-01",
        "latitude": 52.51038,
        "longitude": 13.39763,
        "email": "club@cyberbotics.com",
        "phoneNumber": "+49 12 123 456 789",
        "timezone": "Central European Standard Time",
        "address": {
          "line1": "Leipziger Str. 46/47",
          "line2": "",
          "city": "Berlin",
          "postalCode": "10-117",
          "country": "Germany"
        },
        "isDeleted": false,
        "isHidden": false
      },
      "id": 1677,
      "timestamp": 254718,
      "isDeleted": false,
      "startDate": "2015-12-03T06:15:00",
      "endDate": "2015-12-03T07:15:00",
      "attendeesCount": 7,
      "attendeesLimit": 20,
      "clubZone": "Fitness",
      "clubZoneMapUrl": "https://yourdomain.perfectgym.pl/Api/Files/Photo?xxxxxxxxx",
      "allowBookSeatNumber": true
    }
  ]
}

Set up presence for a booked user alt text

POST Classes/UserPresence

Parameters

Name Type Description
classId long Required. Class identifier.
userId long Required. User identifier.
isPresent boolean Required. Indicates presence in class

Example request

In this example, we set the user's presence with the identifier 25 for the class with the identifier6

curl -X POST 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json" 
     -d '{
        "classId": 6,
        "userId": 25,
        "isPresent": true               
    }' 
    http://yoursubdomain.perfectgym.com/Api/Classes/UserPresence
Perfect Gym api