Core API Documentation
Event Occurrence
A scheduled instance of a Service. For example, the phrase "Group Workout from 9am-10am on 2014/09/01" could be used to describe an Event Occurrence.
Front
No authentication required.
GET /api/v2/front/event_occurrences
This returns a list of publicly viewable GroupClasses and Courses for a time range (defaulting to today). The parameters
Parameters
| from | timestamp | Start of time range filter. Defaults to beginning of day, today. |
|---|---|---|
| to | timestamp | End of time range filter. Defaults to end of day, today. |
| ids | comma delimited string | Event occurrence id(s) to filter on. Does not yield errors if event occurrence does not exist. |
| state | comma delimited string |
State of the event occurrence. Multiple values can be specified when separated by a comma.
For example, |
| staff_member_ids | comma delimited string | The staff member identifier(s) to filter on. Yields errors if staff member does not exist. |
| service_ids | comma delimited string | The service identifier(s) to filter on. Yields errors if service does not exist. |
| event_ids | comma delimited string | The event identifier(s) to filter on. Yields errors if event does not exist. |
| location_ids | comma delimited string | The location identifier(s) to filter on. Yields errors if location does not exist. |
REQUEST
$ curl "https://mybiz.pike13.com/api/v2/front/event_occurrences?from=2014-09-12T07:00:00Z&to=2014-09-13T07:00:0Z&client_id=XXXXXXXXXXXXXX"
RESPONSE
{
"event_occurrences": [
{
"id": 262,
"event_id": 3,
"name": "Group Workout",
"description": "Ut omnis quibusdam porro qui laudantium maxime quidem.",
"service_id": 1,
"location_id": 1,
"start_at": "2014-09-12T16:00:00Z",
"end_at": "2014-09-12T18:00:00Z",
"url": "http://mybiz.pike13.com/e/262",
"timezone": "America/Los_Angeles",
"state": "active",
"full": false,
"capacity_remaining": 18,
"staff_members": [
{
"id": 1,
"name": "John Staff"
}
],
"waitlist": {
"full": false
}
}
]
}
GET /api/v2/front/event_occurrences/:id
Returns the details of an individual Event Occurrence.
Some differences from the
- Appointments are returned if the authenticated person is the enrollee.
- People are not included with the Event Occurrences.
- Visit data not included with the Event Occurrences.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/event_occurrences/1?client_id=XXXXXXXXXXXXXX
RESPONSE
{
"event_occurrences": [
{
"id": 262,
"event_id": 3,
"name": "Group Workout",
"description": "Ut omnis quibusdam porro qui laudantium maxime quidem.",
"service_id": 1,
"location_id": 1,
"start_at": "2014-09-12T16:00:00Z",
"end_at": "2014-09-12T18:00:00Z",
"url": "http://mybiz.pike13.com/e/262",
"timezone": "America/Los_Angeles",
"state": "active",
"full": false,
"capacity_remaining": 18,
"staff_members": [
{
"id": 1,
"name": "John Staff"
}
],
"waitlist": {
"full": false
}
}
]
}
GET /api/v2/front/event_occurrences/summary
Returns a count of event occurrences by day or by hour of each day
Parameters
| from | timestamp | Start of time range filter. Defaults to beginning of day, today. |
|---|---|---|
| to | timestamp | End of time range filter. Defaults to end of day, today. |
| group_by | string |
Grouping of the counts. Possible values:
|
| location_ids | comma delimited string | The location identifier(s) to filter on. |
| service_ids | comma delimited string | The service identifier(s) to filter on. |
| service_types | comma delimited string |
The service type(s) to filter on. Possible values:
|
| staff_member_ids | comma delimited string | The staff member identifier(s) to filter on. |
| state | comma delimited string |
State of the event occurrence. Multiple values can be specified when separated by a comma.
For example, |
REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/event_occurrences/summary?client_id=XXXXXXXXXXXXXX
RESPONSE
{
"2017-05-01": 0,
"2017-05-02": 1
}
REQUEST
$ curl "https://mybiz.pike13.com/api/v2/front/event_occurrences/summary?group_by=hour&client_id=XXXXXXXXXXXXXX"
RESPONSE
{
"2017-05-01": {
"0": 0,
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0,
"10": 0,
"11": 0,
"12": 0,
"13": 0,
"14": 0,
"15": 0,
"16": 1,
"17": 0,
"18": 0,
"19": 0,
"20": 0,
"21": 0,
"22": 0,
"23": 0
},
"2017-05-02": {
"0": 0,
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0,
"10": 0,
"11": 0,
"12": 0,
"13": 0,
"14": 0,
"15": 0,
"16": 0,
"17": 0,
"18": 0,
"19": 0,
"20": 0,
"21": 0,
"22": 0,
"23": 0
}
}
Desk
GET /api/v2/desk/event_occurrences
This returns a list of Event Occurrences for a time range (defaulting to today). The parameters
When the business has rooms enabled, each event occurrence may include a read-only
The
Parameters
| from | timestamp | Start of time range filter. Defaults to beginning of day, today. |
|---|---|---|
| to | timestamp | End of time range filter. Defaults to end of day, today. |
| ids | comma delimited string | Event occurrence id(s) to filter on. Does not yield errors if event occurrence does not exist. |
| state | comma delimited string |
State of the event occurrence. Multiple values can be specified when separated by a comma.
For example, |
| staff_member_ids | comma delimited string | The staff member identifier(s) to filter on. Yields errors if staff member does not exist. |
| service_ids | comma delimited string | The service identifier(s) to filter on. Yields errors if service does not exist. |
| event_ids | comma delimited string | The event identifier(s) to filter on. Yields errors if event does not exist. |
| location_ids | comma delimited string | The location identifier(s) to filter on. Yields errors if location does not exist. |
REQUEST
$ curl "https://mybiz.pike13.com/api/v2/desk/event_occurrences?from=2014-09-12T07:00:00Z&to=2014-09-13T07:00:0Z" \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"event_occurrences": [
{
"id": 1,
"event_id": 1,
"name": "Hair Cut",
"description": "Rerum adipisci at nam quae omnis autem.",
"service_id": 6,
"location_id": 1,
"start_at": "2014-09-11T09:00:00Z",
"end_at": "2014-09-11T10:00:00Z",
"timezone": "America/Los_Angeles",
"attendance_complete": false,
"state": "active",
"full": true,
"visits_count": 1,
"capacity_remaining": 0,
"staff_members": [
{
"id": 1,
"name": "John Staff"
}
],
"people": [
{
"id": 59,
"name": "Jane Doe",
"email": null,
"visit_id": 301,
"visit_state": "completed"
}
],
"resources": [
{
"id": 1,
"name": "Studio A",
"description": "Main studio room.",
"position": 1,
"category_id": 2,
"location_id": 1,
"service_ids": [
6
],
"availability": {
"allow_to_book": true,
"capacity": 12,
"room_booking_length": 60,
"start_interval": 15,
"before_time": 0,
"after_time": 0,
"show_remaining_spaces": false
}
}
]
},
{
"id": 262,
"event_id": 3,
"name": "Group Workout",
"description": "Ut omnis quibusdam porro qui laudantium maxime quidem.",
"service_id": 1,
"location_id": 1,
"start_at": "2014-09-12T16:00:00Z",
"end_at": "2014-09-12T18:00:00Z",
"timezone": "America/Los_Angeles",
"attendance_complete": false,
"state": "active",
"full": false,
"visits_count": 2,
"capacity_remaining": 18,
"staff_members": [
{
"id": 1,
"name": "John Staff"
}
],
"people": [
{
"id": 3,
"name": "John Client",
"email": "johnclient@example.com",
"visit_id": 302,
"visit_state": "registered"
},
{
"id": 48,
"name": "Jane Client",
"email": "janeclient@example.com",
"visit_id": 303,
"visit_state": "registered"
}
]
}
]
}
GET /api/v2/desk/event_occurrences/:id
Returns the details of an individual Event Occurrence.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/event_occurrences/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"event_occurrences": [
{
"id": 1,
"event_id": 3,
"name": "Group Workout",
"description": "Ut omnis quibusdam porro qui laudantium maxime quidem.",
"service_id": 1,
"location_id": 1,
"updating": false,
"start_at": "2014-09-12T16:00:00Z",
"end_at": "2014-09-12T18:00:00Z",
"timezone": "America/Los_Angeles",
"attendance_complete": false,
"state": "active",
"full": false,
"visits_count": 2,
"capacity_remaining": 18,
"staff_members": [
{
"id": 1,
"name": "John Staff"
}
],
"people": [
{
"id": 3,
"name": "John Client",
"email": "johnclient@example.com",
"visit_id": 6,
"visit_state": "completed"
},
{
"id": 48,
"name": "Jane Client",
"email": "janeclient@example.com",
"visit_id": 7,
"visit_state": "completed"
}
],
"resources": [
{
"id": 1,
"name": "Studio A",
"description": "Main studio room.",
"position": 1,
"category_id": 2,
"location_id": 1,
"service_ids": [
1
],
"availability": {
"allow_to_book": true,
"capacity": 12,
"room_booking_length": 60,
"start_interval": 15,
"before_time": 0,
"after_time": 0,
"show_remaining_spaces": false
}
}
],
"visits": [
{
"id": 6,
"person_id": 3,
"status": "unpaid",
"registered_at": "2014-09-12T20:49:43Z",
"completed_at": "2014-09-12T20:49:43Z",
"created_at": "2014-09-12T20:49:43Z",
"noshow_at": null,
"cancelled_at": null,
"paid": false,
"paid_for_by": null
},
{
"id": 7,
"person_id": 48,
"status": "complete",
"registered_at": "2014-09-17T21:18:59Z",
"completed_at": "2014-09-17T21:18:59Z",
"created_at": "2014-09-17T21:18:59Z",
"noshow_at": null,
"cancelled_at": null,
"paid": true,
"paid_for_by": "Group Workout"
}
]
}
]
}
GET /api/v2/desk/event_occurrences/summary
Returns a count of event occurrences by day or by hour of each day
Parameters
| from | timestamp | Start of time range filter. Defaults to beginning of day, today. |
|---|---|---|
| to | timestamp | End of time range filter. Defaults to end of day, today. |
| group_by | string |
Grouping of the counts. Possible values:
|
| location_ids | comma delimited string | The location identifier(s) to filter on. |
| service_ids | comma delimited string | The service identifier(s) to filter on. |
| service_types | comma delimited string |
The service type(s) to filter on. Possible values:
|
| staff_member_ids | comma delimited string | The staff member identifier(s) to filter on. |
| state | comma delimited string |
State of the event occurrence. Multiple values can be specified when separated by a comma.
For example, |
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/event_occurrences/summary \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"2017-05-01": 0,
"2017-05-02": 1
}
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/event_occurrences/summary?group_by=hour \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"2017-05-01": {
"0": 0,
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0,
"10": 0,
"11": 0,
"12": 0,
"13": 0,
"14": 0,
"15": 0,
"16": 1,
"17": 0,
"18": 0,
"19": 0,
"20": 0,
"21": 0,
"22": 0,
"23": 0
},
"2017-05-02": {
"0": 0,
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0,
"10": 0,
"11": 0,
"12": 0,
"13": 0,
"14": 0,
"15": 0,
"16": 0,
"17": 0,
"18": 0,
"19": 0,
"20": 0,
"21": 0,
"22": 0,
"23": 0
}
}
POST /api/v2/desk/event_occurrences/:id/cancel
Cancels a single event occurrence. On success the response is
When
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/event_occurrences/1/cancel \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"cancellation": {
"remove_from_calendar": false,
"notify_clients": true,
"notes_attributes": { "0": { "note": "Class cancelled due to weather." } },
"issue_make_up_passes": true,
"make_up_attributes": {
"make_up_reason_id": 1,
"free_form_reason": "Weather closure"
}
}
}'
RESPONSE
{
"make_up_skipped_visits": [
{
"visit_id": 698542046,
"person_id": 14400961
}
]
}
Attributes (cancellation object, required)
| remove_from_calendar | boolean | If true, removes the occurrence from the calendar instead of only cancelling it. Defaults to false. | ||||||
|---|---|---|---|---|---|---|---|---|
| notify_clients | boolean | If true, sends client notifications; use with notes_attributes. Defaults to false. | ||||||
| notes_attributes | object | Nested note payload when notify_clients is true (e.g. hash of index keys to { note: "..." }). | ||||||
| issue_make_up_passes | boolean | If true, attempts make-up passes for registered enrollments that can be punched after cancellation (others are skipped). Defaults to false. | ||||||
| make_up_attributes | object |
Include when
|
Response attributes (when issue_make_up_passes is true)
| make_up_skipped_visits | array | Registered visits that did not get a make-up pass because they have no applicable plan or pass. Empty when every registered visit received one.
|
|---|
POST /api/v2/desk/event_occurrences/:id/change
Changes the staff members assigned to a single event occurrence. On success the response is
Send the complete set of staff members you want assigned in
Only the specified occurrence is changed, even when it belongs to a recurring event. To change a whole series, use the staff web UI.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/event_occurrences/1/change \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"change": {
"notify_clients": true,
"notify_staff_members": true,
"new_ical_attributes": {
"organizer_ids": [12, 34]
}
}
}'
Attributes (change object, required)
| notify_clients | boolean | Notifies the clients registered for the occurrence. Defaults to true, so clients are notified unless you send false. | |||
|---|---|---|---|---|---|
| notify_staff_members | boolean | Notifies the staff members added to and removed from the occurrence. Defaults to true, so staff members are notified unless you send false. | |||
| new_ical_attributes | object | Omit this object entirely to make no change. The request still succeeds and no change is recorded.
|
A
Every staff member id you add must belong to this business and be assignable, matching the staff list
the web UI offers. If any added id does not,