Book a class session
This API helps you to create a booking for the specified class session for a signed-in guest.
You must provide a unique identifier of the session as session_id in the API request. The API then returns the RegistrationId and RegistrationStatusId details of the booking.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
POST /Appointments/Sessions
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| session_id | integer (int64) | Yes | — | Mandatory Unique identifier of the required class session to be booked. |
| booking_source | enum () | No | — | Optional Source from which the class session is to be booked. The possible values for this parameter are: 0 = Store, 1 = Mobile, 2 = Web, and 3 = BookingWizardAdvancedMode. |
Response
Success (201 Created)
{}
Example
curl --request POST \
--url 'https://api.zenoti.com/Appointments/Sessions?session_id={{session_id}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/Appointments/Sessions', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/Appointments/Sessions',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.PostAsync(
"https://api.zenoti.com/Appointments/Sessions");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/Appointments/Sessions')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |