ASDinCloudDocs
API ReferenceTeam attendance

Team attendance

View as Markdown

The attendance record object

View as Markdown

Each attendance record represents one athlete and session. Monthly and day-update responses use a compact form with date, slot, and presence.

Attributes

idinteger
Identifier assigned by the API.
sport_idinteger
Sport associated with the record.
team_idinteger
ID of the team.
athlete_idinteger
ID of the athlete.
session_atdatetime object
Session timestamp and timezone. checkin_at is the same value as a string.
checkin_atstring
Session timestamp in YYYY-MM-DD HH:MM:SS format.
presentboolean
Whether the athlete attended.
set_by_rolestring
Role that recorded the attendance, coach or admin.
set_by_staff_idinteger or null
Staff record associated with the entry, when available.
athlete_fullnamestring or null
Full name of the athlete.
team_namestring or null
Name of the team.
coach_fullnamestring or null
Name of the staff member who recorded the entry, when available.
created_atdatetime object
Creation timestamp and timezone.
updated_atdatetime object
Last update timestamp and timezone.

List team attendance

View as Markdown
GET/api/v1/team_attendance

Lists individual attendance records with team and athlete names.

Permissions

Send your API key in X-API-Key. Required permissions are Team attendance → Read.

Headers

X-Sport-Idinteger
Use the sport ID to limit the response to one sport.

Query parameters

team_idinteger
Limit the response to one team.
athlete_idinteger
Limit the response to one athlete.
monthstring
Filter by a month in YYYY-MM format. Takes precedence over the date range.
date_fromstring
Inclusive lower bound in YYYY-MM-DD HH:MM:SS format.
date_tostring
Inclusive upper bound in YYYY-MM-DD HH:MM:SS format.
qstring
Search athlete names, staff names, and team names.
lengthinteger
Page size, default 20, maximum 100. Aliases pageSize and per_page.
startinteger
Zero-based offset. Takes precedence over page.
pageinteger
One-based page number when start is omitted.
drawstring
Optional request marker echoed in the response.
sortstring
Sort by id, sport_id, team_id, athlete_id, session_at, checkin_at, present, athlete_fullname, team_name, coach_fullname, created_at, or updated_at. Prefix the field name with a minus sign for descending order.
orderstring
Direction for unprefixed sort fields. Use asc or desc.

Returns

Returns records in data, the counts before and after text search, and the echoed draw marker.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.

Get monthly team attendance

View as Markdown
GET/api/v1/team_attendance/monthly

Returns the attendance report for one team and month.

Permissions

Send your API key in X-API-Key. Required permissions are Team attendance → Read.

Headers

X-Sport-IdintegerRequired
The sport ID from List sports. Use the sport the record belongs to.

Query parameters

team_idintegerRequired
ID of the team in the selected sport.
monthstringRequired
Calendar month in YYYY-MM format.

Returns

Returns the team, sport, days in the month, current athletes, and recorded attendance in data. Each attendance entry has an am or pm slot.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
422
One or more fields failed validation.

Export team attendance

View as Markdown
GET/api/v1/team_attendance/export

Downloads the monthly team attendance report.

Permissions

Send your API key in X-API-Key. Required permissions are Team attendance → Read.

Headers

X-Sport-IdintegerRequired
The sport ID from List sports. Use the sport the record belongs to.

Query parameters

team_idintegerRequired
ID of the team in the selected sport.
monthstringRequired
Calendar month in YYYY-MM format.

Returns

Returns a semicolon-delimited CSV with one column per day and a total per athlete. X indicates one attended slot and XX indicates two.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
422
One or more fields failed validation.

Update attendance for a day

View as Markdown
PUT/api/v1/team_attendance/day

Sets attendance for one or both slots on a day for a current team athlete.

Permissions

Send your API key in X-API-Key. Required permissions are Team attendance → Write.

Headers

X-Sport-IdintegerRequired
The sport ID from List sports. Use the sport the record belongs to.

Body parameters

team_idintegerRequired
ID of an active team in the selected sport.
athlete_idintegerRequired
ID of a current team athlete.
datestringRequired
Calendar date in YYYY-MM-DD format.
slotsmapRequired
Send am, pm, or both, each with a boolean value. Omitted slots retain their values.

Returns

Returns the athlete, the date, and the attendance entries updated by the request.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
409
The team is archived.
422
An input value is invalid or the athlete is outside the current team.
500
The attendance entries could not be saved.