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

Instructors

Instructor is a summary representation of a fitness class instructor.

Instructor properties

Instructor is described by the following properties

Name Type Description
id long Unique identifier of instructor.
timestamp long Timestamp. Indicates when resource was last modified.
firstName string Instructor's name.
lastName string Instructor's last name.
displayName string Instructor's display name.
email string Instructor's email.
photoUrl string Instructor's photo URL.
sex string Instructor's sex.
Possible values:
  • Male
  • Female
rating Rating Instructor's rating.
isActive bool Indicates if instructor is active.
isDeleted bool Indicates if resource is deleted.
employeePosition string Instructor's position.
clubs Array Instructor available in clubs.
categoriesClasses Array Instructor conducts classes from the selected categories.
services Array Services performed by instructor.

List of instructors at the club alt text alt text

GET Instructors/Instructors

Returns list of active instructors at the club.

Parameters

Name Type Description
clubId long Required. Club identifier

Example request

In this example we fetch list of all instructors at the club with identifier 10

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Instructors/Instructors?clubId=10

Example response

Status: 200 OK
{
  "elements": {
    "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
  }
}

List of instructors with timestamp alt text alt text

GET Instructors/Instructors

Returns paginated list of instructors available in your company.

Parameters

Name Type Description
timestamp long Timestamp. Request returns instructors with timestamp grater then timestamp, defaults to 0.
page int The desired page number (1-based index). Page size is 100. Default to 1.

Example request

In this example we fetch list of all instructors with timestamp greater then 254000

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

Example response

Status: 200 OK
{
  "elements": {
    "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
  }
}

Availability of instructors alt text

GET Instructors/Instructor/Available

Returns paginated list of instructors available in club at a certain time.

Parameters

Name Type Description
page int Limited number of results (page size 100)
clubId long Required. Club identifier
employeeId long Required. Employee identifier
startDate datetime Required. Start date
endDate datetime Required. End date

Example request

In this example we fetch list of employee availability with id 6456 between 2016-01-01 and 2017-01-01

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Instructors/Instructor/Available?clubId=38&employeeId=6456&startDate=2016-01-01&endDate=2017-01-01

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 52,
      "clubId": "38",
      "employeeFirstName": "Agatha",
      "employeeLastName": "Strickland",
      "employeeId": "6456",
      "startDate": "2016-05-24T09:30:00",
      "endDate": "2016-05-24T11:30:00"
    },
    {
      "id": 52,
      "clubId": "38",
      "employeeFirstName": "Agatha",
      "employeeLastName": "Strickland",
      "employeeId": "6456",
      "startDate": "2016-05-24T12:30:00",
      "endDate": "2016-05-24T19:30:00"
    }
  ]
}

Instructor training schedule alt text

GET Instructors/Instructor/Sheduler

Returns list of instructor activity.

Parameters

Name Type Description
page int Limited number of results (page size 100)
clubId long Required. Club identifier
employeeId long Required. Employee identifier
startDate datetime Required. Start date
endDate datetime Required. End date

Example request

In this example we fetch list of activity assigned to employee with id 6456 between 2016-01-28 and 2016-01-29

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Instructors/Instructor/Sheduler?clubId=38&employeeId=6456&startDate=2016-01-28&endDate=2016-01-29

Example response

Status: 200 OK
{
  "elements": [
    {
      "hourStartDate": "2016-01-29T15:30:00",
      "hourEndDate": "2016-01-29T16:30:00",
      "employeeTopicVersion": 470726050,
      "periods": [
        {
          "periodStart": "2016-01-29T15:30:00",
          "periodEnd": "2016-01-29T15:45:00",
          "isBusy": false
        },
        {
          "periodStart": "2016-01-29T15:45:00",
          "periodEnd": "2016-01-29T16:00:00",
          "isBusy": false
        },
        {
          "periodStart": "2016-01-29T16:00:00",
          "periodEnd": "2016-01-29T16:15:00",
          "isBusy": false
        },
        {
          "periodStart": "2016-01-29T16:15:00",
          "periodEnd": "2016-01-29T16:30:00",
          "isBusy": false
        }
      ],
      "rowType": "A",
      "ptBookingEventId": 20887,
      "startDate": "2016-01-29T15:30:00",
      "endDate": "2016-01-29T17:30:00",
      "employeeId": 2,
      "employeeName": "Jan",
      "employeeLastName": "Mich",
      "employeeFullName": "Jan Mich",
      "clubId": 38,
      "employeeUserId": 0,
      "availabilityType": "NoLimits"
    }
  ]
}
Perfect Gym api