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

User classes

User class represents fitness class conducted in your club.

Class properties

User class holds the same data as Classes plus user specyfic properties. Only user specyfic properties are described here.

Name Type Description
booked bool true if user is signed up for classes, false otherwise.
attended bool true if user has attended classes, false otherwise.
standby bool true if user is on a standby list, false otherwise.
userClassRating int User class rating. Value of 1 - 5, represents user rating of selected class. null if user didn't rate class.
userInstructorRating int User instructor rating. Value of 1 - 5, represents user rating of instructor conducting class. null if user didn't rate instructor.
products array Array of Product objects. Products to pay for classes

List user classes in a given timeframe alt text alt text

GET Classes/UserClasses

Returns paginated user classes list.

Employee mode parameters

Name Type Description
userId long Required. User identifier. Request returns classes data for user identified by userId.
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 Optional. Page number, defaults to 1.

User mode parameters

Name Type Description
clubId long Required. Club identifier. Request returns classes for authenticated user 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 Optional. Page number, defaults to 1.

Employee mode example request

In this example we fetch first 100 of all user (with id = 40) 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/UserClasses
        ?userId=40
        &clubId=2
        &startDate=2015-12-01T00:00:00
        &endDate=2015-12-31T23:59:59

Example response

Status: 200 OK
{
  "elements": [
    {
      "booked": true,
      "attended": true,
      "standby": false,
      "userClassRating": 5,
      "userInstructorRating": 4,
      "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"
    }
  ]
}

List user classes with timestamp alt text alt text

GET Classes/UserClasses

Returns paginated user classes list. All feature classes and all past classes user has attended are included.

Employee mode parameters

Name Type Description
userId long Required. User identifier. Request returns classes data for user identified by userId.
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.

User mode parameters

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

Employee mode example request

In this example we fetch list of all user (with id = 40) classes in club with id = 2, with timestamp greater then 254000

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

Example response

Status: 200 OK
{
  "elements": [
    {
      "booked": true,
      "attended": true,
      "standby": false,
      "userClassRating": 5,
      "userInstructorRating": 4,
      "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"
    }
  ]
}

Retrive user class with class identifier alt text alt text

GET Classes/UserClass

Returns individual user class.

Employee mode parameters

Name Type Description
classId long Required. Class identifier. Request returns class identified by classId.
userId long Required. User identifier. Request returns class data for user identified by userId.

User mode parameters

Name Type Description
classId long Required. Class identifier. Request returns class identified by classId for authenticated user.

Employee mode example request

In this example we fetch data for class identified with id = 1677 for user identified with id = 40

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Classes/UserClass
        ?classId=1677
        &userId=40        

Example response

Status: 200 OK
{
  "elements": [
    {
      "booked": true,
      "attended": true,
      "standby": false,
      "userClassRating": 5,
      "userInstructorRating": 4,
      "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"
    }
  ]
}
Perfect Gym api