An event on a location's calendar. Events appear as 'other' events on the calendar, they don't relate to other documents and are used purely to provide visibility of events outside of those managed through the CareHQ application.
A unique Id for the event.
The date/time the event was created.
The date the event ends.
The time the event ends.
The Id of the location this event is associated with.
The date/time the group was modified.
The date the event starts.
The time the event starts.
A short description of the event.
{
"_id": "66bfb4bc9ab4e3d6eb734922",
"created": "2024-08-16 20:21:16",
"end_date": "2024-08-18",
"end_time": "13:00",
"location": "66bfb4bb9ab4e3d6eb734900",
"modified": "2024-08-16 20:21:16",
"start_date": "2024-08-18",
"start_time": "10:00",
"title": "Open morning"
}
Return a list of calendar events.
['_id']
A list of attributes to include for fetched objects.
A filter that accepts a date and filters events to those that start on or before the given date.
A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.
A filter that accepts a list of location Ids and filters events by the location they are associated with.
A filter that accepts a date/time and filters the items returned to those modified after the date/time.
A filter that accepts a date/time and filters the items returned to those modified before the date/time.
A case insensitive keyword filter applied to the following fields; title.
A filter that accepts a date and filters events to those that start on or after the given date.
1
The page number to fetch.
10
The number of items to return per page.
_id
A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.
Returns a page of events.
var events = apiClient.Request(
HttpMethod.Get,
"events",
new MultiValueDict()
.Add("attributes", "title", "start_date", "start_time")
.Add("filters-location", locationId)
.Add("sort_by", "start_date_time")
);
<?php
$events = $api_client->request(
'GET',
'events',
[
'attributes'=>['title', 'start_date', 'start_time'],
'filters-location'=>$location_id,
'sort_by'=>'start_date_time'
]
);
events = api_client(
'GET',
'events',
params={
'attributes': ['title', 'start_date', 'start_time'],
'filters-location': location_id,
'sort_by': 'start_date_time'
}
)
events = api_client.request(
'GET',
'events',
params: {
'attributes' => ['title', 'start_date', 'start_time'],
'filters-location' => location_id,
'sort_by' => 'start_date_time'
}
)
{
"item_count": 2,
"items": [
{
"_id": "66bfb4bc9ab4e3d6eb734922",
"start_date": "2024-08-18",
"start_time": "10:00",
"title": "Open morning"
},
{
"_id": "66bfb4bc9ab4e3d6eb734920",
"start_date": "2024-08-20",
"start_time": null,
"title": "CQC inspection"
}
],
"page": 1,
"page_count": 1,
"per_page": 10
}
var event = apiClient.Request(HttpMethod.Get, $"events/{eventId}");
<?php
$event = $api_client->request('GET', 'events/' . $event_id);
event = api_client('GET', f'events/{event_id}')
event = api_client.request('GET', "events/#{event_id}")
{
"_id": "66bfb4bc9ab4e3d6eb734922",
"created": "2024-08-16 20:21:16",
"end_date": "2024-08-18",
"end_time": "13:00",
"location": "66bfb4bb9ab4e3d6eb734900",
"modified": "2024-08-16 20:21:16",
"start_date": "2024-08-18",
"start_time": "10:00",
"title": "Open morning"
}