Classes
This API documentation provides a comprehensive guide for interacting with the class management system in Whautomate. This allows you to interact using API and sync classes between multiple systems.
Here's a breakdown of the functionalities offered:
- Search or Retrieve Classes (GET /v1/classes): This method allows you to find specific classes or retrieve a full list. You can optionally filter the results based on various criteria (e.g., date range, location, instructor).
- Get Individual Class By Id (GET /v1/classes/{classId}): Use this method to retrieve detailed information about a particular class by providing its unique identifier.
- Create a New Class (POST /v1/classes): This method enables you to create new classes by specifying details like date, time, location, instructor, service (type of class), and any other relevant information.
- Update Class (PUT /v1/classes/{classId}): Modify details of an existing class using this method. You can update information like date, time, instructor, or other relevant attributes.
- Delete Class By Id (DELETE /v1/classes/{classId}): This method allows you to permanently remove a class from the schedule.
- Get Participants of a Class (GET /v1/classes/{classId}/participants): Retrieve a list of participants enrolled in a specific class by providing its unique identifier.
- Add Participant to Class (POST /v1/classes/{classId}/participants/add): This method allows you to enroll participants in a specific class.
- Remove Participant from Class (POST /v1/classes/{classId}/participants/cancel): Use this method to cancel a participant's enrollment from a specific class.
- Get Class bookings of a Client (GET /v1/classes/clients/{clientId}/bookings): Use this method to get all the classes booked by a particular client using their Id.
By leveraging this API, you can streamline your class management process, ensuring a clear and organized class schedule along with efficient participant management.
api.whautomate.comSearch or retrieve Classes
/v1/classesx-api-keystringrequiredlimitstringstaffIdstringendDatestringlocationIdstringpagestringstartDatestringidstringrequiredlocationobjectrequiredstaffobjectrequiredtimezonestringdatestringrequiredtimestringrequiredstartTimeUTCstringstartTimestringendTimeUTCstringendTimestringserviceobjectrequiredbookedParticipantsintegernumberOfParticipantsintegerstatusstringcreatedAtstringupdatedAtstringcurl -X GET "https://api.whautomate.com/v1/classes" \
-H "x-api-key: YOUR_API_KEY"
[
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
]
Get Individual Class By Id
/v1/classes/{classId}x-api-keystringrequiredclassIdstringrequiredidstringrequiredlocationobjectrequiredstaffobjectrequiredtimezonestringdatestringrequiredtimestringrequiredstartTimeUTCstringstartTimestringendTimeUTCstringendTimestringserviceobjectrequiredbookedParticipantsintegernumberOfParticipantsintegerstatusstringcreatedAtstringupdatedAtstringcurl -X GET "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY"
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
Create a new Class
/v1/classesx-api-keystringrequiredlocationobjectrequiredstaffobjectrequireddatestringrequiredtimestringrequiredserviceobjectrequirednumberOfParticipantsintegertimezonestringisOnlineClassbooleanonlineClassLinkstringonlineClassPassCodestringadvanceSettingsobjectBooking and cancellation cut-offs (optional)
idstringrequiredlocationobjectrequiredstaffobjectrequiredtimezonestringdatestringrequiredtimestringrequiredstartTimeUTCstringstartTimestringendTimeUTCstringendTimestringserviceobjectrequiredbookedParticipantsintegernumberOfParticipantsintegerstatusstringcreatedAtstringupdatedAtstringcurl -X POST "https://api.whautomate.com/v1/classes" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"date": "string",
"time": "string",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"numberOfParticipants": 0,
"timezone": "string"
}'
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
Update Class
/v1/classes/{classId}x-api-keystringrequiredclassIdstringrequiredlocationobjectrequiredstaffobjectrequireddatestringrequiredtimestringrequiredserviceobjectrequirednumberOfParticipantsintegertimezonestringisOnlineClassbooleanonlineClassLinkstringonlineClassPassCodestringadvanceSettingsobjectBooking and cancellation cut-offs (optional)
idstringrequiredlocationobjectrequiredstaffobjectrequiredtimezonestringdatestringrequiredtimestringrequiredstartTimeUTCstringstartTimestringendTimeUTCstringendTimestringserviceobjectrequiredbookedParticipantsintegernumberOfParticipantsintegerstatusstringcreatedAtstringupdatedAtstringcurl -X PUT "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"date": "string",
"time": "string",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"numberOfParticipants": 0,
"timezone": "string"
}'
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
Delete Class By Id
/v1/classes/{classId}x-api-keystringrequiredclassIdstringrequiredsuccessbooleancurl -X DELETE "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY"
{
"success": true
}
Get Participants of a Class
/v1/classes/{classId}/participantsx-api-keystringrequiredclassIdstringrequiredidstringclientobjectpaymentStatusstringstatusstringcreatedAtstringupdatedAtstringcurl -X GET "https://api.whautomate.com/v1/classes/{classId}/participants" \
-H "x-api-key: YOUR_API_KEY"
[
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
]
Add Participant to Class
/v1/classes/{classId}/participants/addx-api-keystringrequiredclassIdstringrequiredclientobjectrequiredstatusstring (enum)BOOKED, WAITLISTED.idstringclientobjectpaymentStatusstringstatusstringcreatedAtstringupdatedAtstringcurl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/add" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string"
},
"status": "BOOKED"
}'
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
Add Participant to Class with Payment
Books a client into a class like the customer booking portal does. If the class service accepts payment online and the client has no credits to use, nothing is booked yet: the place is held, a payment link is returned and the client is added when they pay. If the class is full and the waitlist is on, the client is waitlisted without payment. Otherwise the client is booked straight away. Needs the Bookings add-on.
/v1/classes/{classId}/participants/add-with-paymentx-api-keystringrequiredclassIdstringrequiredclientobjectrequiredEither the id of an existing client, or fullName, countryCode and phone for a new one.
bookingTypestringCLASS.statusstringPAYMENT_PENDING, BOOKED or WAITLISTED.paymentRequiredbooleancurrencystringpaymentobjectorderId, paymentLink, currency, subTotal, taxAmount, totalAmount, expiresAt, expiresInMinutes and message. Otherwise null.classParticipantobjectid, client, status, classId, className, classDate, classTime and createdAt.curl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/add-with-payment" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": { "id": "CLIENT_ID" }
}'
{
"bookingType": "CLASS",
"status": "PAYMENT_PENDING",
"paymentRequired": true,
"currency": "SGD",
"payment": {
"orderId": "string",
"paymentLink": "https://...",
"currency": "SGD",
"subTotal": 25,
"taxAmount": 2.25,
"totalAmount": 27.25,
"expiresAt": "2026-10-15T10:10:00.000Z",
"expiresInMinutes": 10,
"message": "string"
},
"classId": "CLASS_ID"
}
Get a Participant of a Class
/v1/classes/{classId}/participants/{participantId}x-api-keystringrequiredclassIdstringrequiredparticipantIdstringrequiredidstringclientobjectid and fullName.paymentStatusstringstatusstringcreatedAtstringupdatedAtstringcurl -X GET "https://api.whautomate.com/v1/classes/{classId}/participants/{participantId}" \
-H "x-api-key: YOUR_API_KEY"
Returns 404 with Participant not found in the class when the participant is not in that class.
Remove Participant from Class
/v1/classes/{classId}/participants/cancelx-api-keystringrequiredclassIdstringrequiredparticipantIdstringrequiredcancellationReasonstringidstringclientobjectpaymentStatusstringstatusstringcreatedAtstringupdatedAtstringcurl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/cancel" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"participantId": "string",
"cancellationReason": "string"
}'
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
Get Class Bookings of Particular Client
/v1/classes/clients/{clientId}/bookingsx-api-keystringrequiredclientIdstringrequiredlimitstringendDatestringlocationIdstringpagestringstartDatestringidstringclientobjectpaymentStatusstringstatusstringcreatedAtstringupdatedAtstringclassobjectcurl -X GET "https://api.whautomate.com/v1/classes/clients/{clientId}/bookings" \
-H "x-api-key: YOUR_API_KEY"
[
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z",
"class": {
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
}
]