Retrieve the session registrations of a guest

GET https://api.zenoti.com/Appointments/Sessions

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

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /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
user_id string Yes — Mandatory Unique identifier of the guest for whom you want to retrieve the class session registrations.
startDate string (date) No — 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 — 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.
center_id string No — Optional Unique identifier of the center for which you want to retrieve the guest's registered class sessions.
sorters[0].Property string No — Optional Name of the property for which you want to sort the search results in the API response. Currently, this parameter only supports the values for the startDate parameter.
sorters[0].Ascending boolean No — Optional Indicates whether you want to sort the search results of the property in an ascending manner in the API response.

Response

Success (200 OK)

{
  "Success": true,
  "results": [
    {
      "...": "..."
    }
  ],
  "total": 8,
  "Error": {}
}

Response fields

Field Type Description
Success boolean
results object[]
results[].Id integer
results[].StartTime string
results[].EndTime string
results[].StartTimeUTC string
results[].EndTimeUTC string
results[].SessionName string
results[].RegistrationStatus integer
results[].SessionStatus integer
results[].InstructorId string
results[].Instructor string
results[].ImagePaths object
results[].Center string
results[].CancellationFeeWindow object
results[].CancellationFee object
results[].ClassName string
results[].ClassDescription object
results[].ClassHtmlDescription string
results[].SessionDescription object
results[].SessionHtmlDescription string
results[].CanCancel boolean
results[].ClassImagePaths object
results[].CurrentWaitlistPosition integer
total integer
Error object

Example

curl --request GET \
  --url 'https://api.zenoti.com/Appointments/Sessions?user_id={{user_id}}' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/Appointments/Sessions', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.get(
    '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.GetAsync(
    "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::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