Retrieve the attendance of an employee
This API requires a date range and the employee id of the employee whose attendance is intended.
it returns an object list indicating attendance in the sate range, below is the details of the object
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/employees/{employee_id}/attendance
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| employee_id | string | Yes | Unique identifier of the employee. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| center_id | string | No | — | Unique identifier of the center. |
| start_date | string (date) | No | — | Start date for retrieving the attendance of the employee. |
| end_date | string (date) | No | — | End date for retrieving the attendance of the employee. |
Response
Success (200 OK)
{
"attendance": [
{
"...": "..."
}
],
"total_records": 4
}
Response fields
| Field | Type | Description |
|---|---|---|
| attendance | object[] | |
| attendance[].schedule_id | string | |
| attendance[].attendance_date | string | |
| attendance[].center_name | string | |
| attendance[].status | string | |
| attendance[].status_id | integer | |
| attendance[].expected_checkin | string | |
| attendance[].actual_checkin | string | |
| attendance[].expected_checkout | string | |
| attendance[].actual_checkout | string | |
| attendance[].category | string | |
| attendance[].comments | string | |
| attendance[].keywords | string | |
| total_records | integer |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/employees/{employee_id}/attendance' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/employees/{employee_id}/attendance', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/employees/{employee_id}/attendance',
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/employees/{employee_id}/attendance");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/employees/{employee_id}/attendance')
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 |