host

Returns a list of semesters

Changed on

A semester groups a recurring set of classes that customers enrol into as a whole.

The id returned here is the stable identifier of the group. Individual classes report it as semesterId on GET /api/v2/host/sessions, so the two endpoints can be joined to attribute a class - or a sale made against one - to the semester it belongs to.

activeFrom and activeTo filter on overlap, not containment: a semester running January to June is returned for activeFrom=2021-03-01&activeTo=2021-03-31.

get/api/v2/host/semesters

Request

  • Base URL
    https://api.momence.com
  • Auth
    OAuth 2
    Authorization code/api/v2/auth/authorize
    Password
    Token URL/api/v2/auth/token

Query parameters

pageinteger required

Starts at 0

pageSizeinteger required
Example:10
sortOrder'ASC' | 'DESC'
sortBy'startsAt' | 'endsAt' | 'name'

Field to sort by

activeFromstring date-time

only return semesters that are still running on or after this date

activeTostring date-time

only return semesters that have started on or before this date

includeCancelledboolean

also include cancelled semesters

includeDraftsboolean

also include unpublished (draft) semesters

Response

Example response

{
  "pagination": {
    "pageSize": 10,
    "totalCount": 1
  },
  "payload": [
    {
      "id": 1,
      "name": "Beginner Yoga Course",
      "startsAt": "2021-08-01T00:00:00Z",
      "endsAt": "2021-08-29T23:59:59Z"
    }
  ]
}

Changes