Retrieve the class session registrations of a guest
This API helps you to retrieve the list of class sessions for which the specified guest has registered.
You must provide the appropriate details in the API request for the user_id parameter. Optionally, you can also specify the required details in the API request for several other parameters to filter the search results in the API response. Refer to the Request Parameters table for more information.
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
GET /api/Appointments/Admin/Sessions
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| UserId | string | Yes | — | Mandatory Unique identifier of the guest for whom you want to retrieve the class session registrations. |
| startDate | string (date) | No | 00:00:00 | Optional Registered class sessions will be returned from the specified start date. You must specify this date in YYYY-MM-DD format. If you do not provide any time details for this parameter, the API considers its default value: 00:00:00. |
| endDate | string (date) | No | 00:00:00 | Optional Registered class sessions will be returned until the specified end date. You must specify this date in YYYY-MM-DD format. If you do not provide any time details for this parameter, the API considers its default value: 00:00:00. |
| CenterId | string | No | — | Optional Unique identifier of the center for which you want to retrieve the guest's registered class sessions. |
| ClassType | integer (int32) | No | — | Optional Type of the class session. |
| page | integer (int32) | No | — | Optional Current page that you want to view. |
| size | integer (int32) | No | — | Optional Number of records to be displayed per page. |
| sorters | object | No | — | Optional Object that contains the property for which you want to sort the search results in the API response and whether you want to sort the records in an ascending or descending manner. This parameters contains the following elements: Property and Ascending. Currently, this parameter only supports the values for the startDate parameter. |
| filters | boolean | No | — | Optional Object that contains these additional elements by using which you can filter the records: Property and Value. |
Response
Success (200 OK)
{}
Example
curl --request GET \
--url 'https://api.zenoti.com/api/Appointments/Admin/Sessions?UserId={{UserId}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/api/Appointments/Admin/Sessions', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/api/Appointments/Admin/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.GetAsync(
"https://api.zenoti.com/api/Appointments/Admin/Sessions");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/api/Appointments/Admin/Sessions')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.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 |