ASDinCloudDocs
API ReferenceMedical certificates

Medical certificates

View as Markdown

The medical certificate object

View as Markdown

Medical certificates record an athlete's certificate validity and any associated attachment.

Attributes

idinteger
Identifier assigned by the API.
sport_idinteger
ID of the sport.
namestring
Display name of the record.
belongs_tostring
Subject type. Use athlete, coach, staff, or parent.
belongs_obj_idinteger
ID of the subject named by belongs_to.
doc_numberstring
Document number, up to 50 characters.
released_atinteger
Issue date, as Unix seconds or an ISO date.
expires_atinteger
Expiration date, as Unix seconds or an ISO date.
got_paperinteger
Whether the club received a paper copy.
notesstring or null
Notes, up to 200 characters.
is_medicalinteger
1 for a medical certificate or 0 for another type of document.
is_agonisticinteger
1 for a competitive certificate, otherwise 0.
urlstring or null
URL for an already-uploaded attachment.
filetypestring or null
MIME type of the attachment.
filesizeinteger or null
Attachment size in bytes.
tscinteger or null
Creation time as a Unix timestamp in seconds.
tsuinteger or null
Last update time as a Unix timestamp in seconds.

List medical certificates

View as Markdown
GET/api/v1/medicals

Lists medical certificate records in the workspace.

Permissions

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

Headers

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

Query parameters

athlete_idinteger
ID of the athlete in the selected sport.
expand_athleteinteger
Use 1 to include the related athlete when available.
qstring
Search document names and any expanded recipient names.
lengthinteger
Number of records to return.
startinteger
Zero-based offset.
drawstring
Optional request marker echoed in the response.
sortstring
Sort by id, name, belongs_to, belongs_obj_id, released_at, expires_at, got_paper, is_agonistic, filetype, filesize, url, tsc, or tsu. Prefix the field name with a minus sign for descending order.
orderstring
Direction for unprefixed sort fields. Use asc or desc.
validitystring
Use valid for certificates that expire today or later. Defaults to all.
got_paperinteger
Use 1 for certificates received on paper, or 0 for the rest.
is_agonisticinteger
Use 1 for competitive certificates, or 0 for non-competitive certificates.
from_dateinteger
Inclusive lower bound on expiry, in Unix seconds.
to_dateinteger
Inclusive upper bound on expiry, in Unix seconds.
pageinteger
One-based page when length and start are omitted.
pageSizeinteger
Page size when using page.

Returns

Returns records in data, counts before and after text search, and the echoed draw marker. The default order is most recent expiration first.

Errors

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

Retrieve a medical certificate

View as Markdown
GET/api/v1/medicals/{id}

Returns one medical certificate by ID.

Permissions

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

Headers

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

Path parameters

idintegerRequired
ID of the medical certificate.

Query parameters

expand_athleteinteger
Use 1 to include the related athlete when available.

Returns

The medical certificate is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.

Create a medical certificate

View as Markdown
POST/api/v1/medicals

Creates a medical certificate.

Permissions

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

Headers

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

Body parameters

athlete_idintegerRequired
ID of the athlete in the selected sport.
doc_numberstringRequired
Document number, up to 50 characters.
released_atinteger or date stringRequired
Issue date, as Unix seconds or an ISO date.
expires_atinteger or date stringRequired
Expiration date, as Unix seconds or an ISO date.
got_paperboolean
Whether the club received a paper copy.
notesstring or null
Notes, up to 200 characters.
is_agonisticboolean
Whether the certificate is for competitive activity.
urlstring or null
URL for an already-uploaded attachment.
filetypestring or null
MIME type of the attachment.
filesizeinteger or null
Attachment size in bytes.

Returns

The created medical certificate is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The athlete was not found in the selected sport.
409
The file is still processing.
422
One or more fields failed validation.
500
The record or attachment association could not be saved.

Update a medical certificate

View as Markdown
PATCH / PUT / POST/api/v1/medicals/{id}

Updates a medical certificate by ID.

Permissions

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

Headers

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

Path parameters

idintegerRequired
ID of the medical certificate.

Body parameters

athlete_idinteger
ID of the athlete in the selected sport.
doc_numberstring
Document number, up to 50 characters.
released_atinteger or date string
Issue date, as Unix seconds or an ISO date.
expires_atinteger or date string
Expiration date, as Unix seconds or an ISO date.
got_paperboolean
Whether the club received a paper copy.
notesstring or null
Notes, up to 200 characters.
is_agonisticboolean
Whether the certificate is for competitive activity.
urlstring or null
URL for an already-uploaded attachment.
filetypestring or null
MIME type of the attachment.
filesizeinteger or null
Attachment size in bytes.

Omitted fields keep their stored value. Use the remove-file endpoint to detach an existing attachment.

Returns

Returns a successful update response.

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 file is still processing.
422
One or more fields failed validation.
500
The record or attachment association could not be saved.

Delete a medical certificate

View as Markdown
DELETE/api/v1/medicals/{id}
POST/api/v1/medicals/{id}/delete

Removes a medical certificate.

Permissions

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

Headers

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

Path parameters

idintegerRequired
ID of the medical certificate.

Returns

Returns a successful removal response.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
400
The record could not be removed.

Remove the attached file

View as Markdown
POST/api/v1/medicals/removeFile

Removes the attachment while preserving the record.

Permissions

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

Headers

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

Body parameters

idintegerRequired
ID of the record. Send as a URL-encoded form field.

Returns

Returns confirmation that the attachment was removed.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
400
There is no attachment or it could not be removed.
404
The requested record was not found.