Retrieve the schedules of employees of a center
This API helps you to retrieve the schedules of employees of the specified center.
You must provide the unique identifier of the center as center_id. You must also specify the appropriate start_date and end_date values for which you want to view the schedules of employees.
Note: To run this request, you must enable the Schedule role permission. This allows the user to access the employee's schedule. Navigate to the organization-level, Security Roles > employee role > Permissions > Employee Manager > Other Settings > Schedule.
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 /v1/centers/{center_id}/employee_schedules
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| center_id | string | Yes | Mandatory Unique 32-character identifier of the center. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| start_date | string (date) | Yes | — | Mandatory Start date from which the schedules of employees of the specified center will be displayed. |
| end_date | string (date) | Yes | — | Mandatory End date until which the schedules of employees of the specified center will be displayed. |
| schedule_status | integer (int32) | No | — | Optional The schedule status of the employee: All = -2, NotScheduled = -1, Working = 0, and the specific code for the respective custom leave. |
| employee_id | string | No | — | Optional Unique 32-character identifier of the employee of the specified center. |
| job_id | string | No | — | Optional Unique 32-character identifier of the employee's assigned job details. |
| consider_schedule_time | boolean | No | — | Optional If true, the API considers the time stamp for the specified date range to filter the response data. If false, the API considers only the date values to filter the employee schedules. |
Response
Success (200 OK)
{
"employee_schedules": [
{
"...": "..."
}
],
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| employee_schedules | object[] | |
| employee_schedules[].employee_id | string | |
| employee_schedules[].employee_name | string | |
| employee_schedules[].schedules | object[] | |
| error | object |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/centers/{center_id}/employee_schedules?start_date={{start_date}}&end_date={{end_date}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/centers/{center_id}/employee_schedules', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/centers/{center_id}/employee_schedules',
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/v1/centers/{center_id}/employee_schedules");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/centers/{center_id}/employee_schedules')
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 |