# Search Classes

This operation searches GroupX Classes by date range.

#### Additional contracts
N/A

Endpoint: GET /classes
Version: 1.0

## Query parameters:

  - `locationId` (string, required)
    ClubMS Location ID, which indicates Location to search Classes in. This ID is returned by Canonical Locations API or provided manually to EGYM admins.

##### Possible reasons of validation errors:
* missing => 400
* notFound => 404

  - `endDateTime` (string, required)
    Defines end of the timerange for Class search

##### Possible reasons of validation errors:
* missing => 400
* wrongFormat => 400
* lessThanStartDateTime => 400

  - `startDateTime` (string, required)
    Defines start of the timerange for Class search

##### Possible reasons of validation errors:
* missing => 400
* wrongFormat => 400
* greaterThanEndDateTime => 400

## Header parameters:

  - `X-User-Secret` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-User-ID` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-User-Locale` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Location-Secret` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Location-ID` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Location-Group-Secret` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Location-Group-ID` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Chain-Secret` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Chain-ID` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Client-Secret` (string)
    see 'Additional Data HTTP Headers' for details.

  - `X-Client-ID` (string)
    see 'Additional Data HTTP Headers' for details.

## Response 200 fields (application/json):

  - `brief` (object, required)
    Brief details of the groupX class for bulk retrieval

  - `brief.id` (string, required)
    Unique ID of the GroupX Class in the ClubMS. This is the same ID that's used in getClassDetails operation

  - `brief.name` (string, required)
    Name of the Class (e.g. 'Yoga 24', 'TRX Small Group', 'Body Pump')

  - `brief.startDateTime` (string, required)
    Start date/time of the GroupX Class in UTC timezone

  - `brief.endDateTime` (string, required)
    End date/time of the GroupX Class in UTC timezone

  - `brief.locationId` (string)
    Unique ID of the location in ClubMS that this class belongs to. This is the same ID as returned by Canonical Locations API or as manually provided to EGYM admins for locations configuration.

  - `brief.free` (boolean)
    Indicates that the class is free (not paid)

  - `brief.waitlisted` (boolean)
    Indicates whether the given exerciser is in the waitlist of this class

  - `brief.childCare` (boolean)
    Defines if child care option is available for the Class

  - `brief.reservable` (boolean)
    Defines if Class is reservable

  - `brief.instructor` (object)
    Required property Information about Intructor who leads the Class

  - `brief.instructor.firstName` (string)

  - `brief.instructor.lastName` (string)

  - `brief.instructor.fullName` (string, required)

  - `brief.instructor.customInfo` (array)
    Key-Value map to represent additional information of an entity.
Partners could contain diverse information of same entities. This type designed to store that information.

  - `brief.instructor.customInfo.key` (string, required)

  - `brief.instructor.customInfo.value` (string, required)

  - `brief.activity` (object)
    Required property Information about Activity of the Class

  - `brief.activity.name` (string, required)
    Name of the Class activity (e.g. 'Yoga 24', 'TRX Small Group', 'Body Pump'), often it is the same as groupX class name, but it might be also a more general name (depends on ClubMS, e.g. 'Yoga', 'TRX')

  - `brief.customInfo` (array)
    Key-Value map to represent additional information of an entity.
Partners could contain diverse information of same entities. This type designed to store that information.

  - `bookingDetails` (object)
    Booking details of the GroupX Class

  - `bookingDetails.capacity` (integer, required)
    Capacity of the GroupX Class for booking online

  - `bookingDetails.booked` (integer, required)
    Spots booked online for this GroupX Class

  - `bookingDetails.waitlistCapacity` (integer, required)

  - `bookingDetails.waitlistBooked` (integer, required)

  - `bookingDetails.availableSpots` (array)

  - `details` (object, required)
    Comprehensive details of the groupX class

  - `details.description` (string)
    Long description of the groupX class

  - `details.room` (object)
    Optional property The room where this class takes place.

  - `details.room.name` (string, required)
    Short name of the room.

  - `details.room.description` (string)
    Details about this room

  - `details.room.roomPhotoUrl` (string)
    URL to the room scheme or photo

  - `details.room.customInfo` (array)
    Key-Value map to represent additional information of an entity.
Partners could contain diverse information of same entities. This type designed to store that information.

  - `details.level` (object)
    Optional property The level of the groupX class (e.g. 'Intermediate', 'Advanced')

  - `details.level.name` (string, required)
    Short name of the level.

  - `details.level.description` (string)
    Details about this level

  - `details.pricing` (object)
    Optional property The price of paid groupX class. If the class is free could be omited

  - `details.pricing.price` (number, required)
    price amount

  - `details.legalNotes` (string)
    Legal notes for this class (often provider specific)

  - `details.customInfo` (array)
    Key-Value map to represent additional information of an entity.
Partners could contain diverse information of same entities. This type designed to store that information.

  - `attendeeBookingDetails` (object)
    Information about attendance of the given exerciser in this GroupX Class

  - `attendeeBookingDetails.exerciserId` (string, required)
    ClubMS Exerciser Unique ID which is returned by Canonical Users API and/or by Canonical Members API.

  - `attendeeBookingDetails.booked` (boolean, required)
    Indicates whether this class is booked by the given exerciser

  - `attendeeBookingDetails.waitlistBooked` (boolean, required)
    Indicates whether the given exerciser is in the waitlist of this class

  - `attendeeBookingDetails.spotBooked` (string)
    Indicates exact spot booked by the given exerciser

  - `attendeeBookingDetails.eligibility` (object)
    Represents booking/cancellation opearions eligibility for Class/Exerciser pair.

  - `attendeeBookingDetails.eligibility.addToClassEligibility` (object, required)
    Represents particular operation eligibility for Class/Exerciser pair providing extra data.

  - `attendeeBookingDetails.eligibility.addToClassEligibility.eligible` (boolean, required)
    Indicates if operation on a given Class is eligible for a give Exerciser.

  - `attendeeBookingDetails.eligibility.addToClassEligibility.lackOfProduct` (boolean)
    Indicates that there are enough products on an Exerciser's account balance to pay for a Class. Products could be Class bundles, points etc.
This attribute must be absent for eligible=true.

  - `attendeeBookingDetails.eligibility.addToClassEligibility.userPaymentOnFile` (boolean)
    Indicates that user has a valid payment source on file to pay for a Class.
This attribute must be absent for eligible=true or lackOfProduct=false.

  - `attendeeBookingDetails.eligibility.bookSpotEligibility` (object)
    Represents particular operation eligibility for Class/Exerciser pair.

  - `attendeeBookingDetails.eligibility.bookSpotEligibility.eligible` (boolean, required)
    Indicates if operation on a given Class is eligible for a given Exerciser.

  - `attendeeBookingDetails.eligibility.removeFromClassEligibility` (object, required)
    Represents particular operation eligibility for Class/Exerciser pair.

  - `attendeeBookingDetails.eligibility.addToWaitlistEligibility` (object, required)
    Represents particular operation eligibility for Class/Exerciser pair providing extra data.

  - `attendeeBookingDetails.eligibility.removeFromWaitlistEligibility` (object, required)
    Represents particular operation eligibility for Class/Exerciser pair.

  - `attendeeBookingDetails.eligibility.updateBookingEligibility` (object)
    Represents particular operation eligibility for Class/Exerciser pair.

  - `attendeeBookingDetails.waitlistPosition` (integer)
    Position of given exerciser in the waitlist of this class


