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": "6724fbc84f73a2cebf63781c",
"created": "2024-11-01 16:03:20",
"end_date": "2024-11-03",
"end_time": "13:00",
"location": "6724fbc74f73a2cebf6377fa",
"modified": "2024-11-01 16:03:20",
"start_date": "2024-11-03",
"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": "6724fbc84f73a2cebf63781c",
"start_date": "2024-11-03",
"start_time": "10:00",
"title": "Open morning"
},
{
"_id": "6724fbc84f73a2cebf63781a",
"start_date": "2024-11-05",
"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": "6724fbc84f73a2cebf63781c",
"created": "2024-11-01 16:03:20",
"end_date": "2024-11-03",
"end_time": "13:00",
"location": "6724fbc74f73a2cebf6377fa",
"modified": "2024-11-01 16:03:20",
"start_date": "2024-11-03",
"start_time": "10:00",
"title": "Open morning"
}