Each entry in the change log represents a change to data within the CareHQ application and provides details on what changed, when and who made the change.
A unique Id for the billing contract.
The date/time the change was logged.
A dictionary containing details of the change.
A dictionary of field values added in the change.
A note in the change log.
A dictionary of values removed in the change.
A dictionary of values updated in the change.
A list of document types the change relates to. Note that the order of the document types field relates to the order of the documents field.
A list of document Ids the change relates to.
The type of change made; ADDED, DELETED, NOTE, UPDATED.
The Id of the user the change was made by. Note that if the change was made by the CareHQ application and not a directly by a user then user will be set as "CareHQ app".
{
"_id": "66bfb4bb9ab4e3d6eb73480b",
"created": "2024-08-16 20:21:15",
"details": null,
"document_types": [
"AccountContact"
],
"documents": [
"66bfb4bb9ab4e3d6eb73480a"
],
"type": "ADDED",
"user": "CareHQ demo builder"
}
Return a list of change log entries.
['_id']
A list of attributes to include for fetched objects.
A filter that accepts a date/time and filters the items returned to those created after the date/time.
A filter that accepts a date/time and filters the items returned to those created before the date/time.
A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.
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 change log entries.
var changeLogEntries = apiClient.Request(
HttpMethod.Get,
"change-log-entries",
new MultiValueDict()
.Add("attributes", "type", "document_types", "document_type")
.Add("sort_by", "created")
);
<?php
$change_log_entries = $api_client->request(
'GET',
'change-log-entries',
[
'attributes'=>['type', 'document_types', 'document_type'],
'sort_by'=>'created'
]
);
change_log_entries = api_client(
'GET',
'change-log-entries',
params={
'attributes': ['type', 'document_types', 'document_type'],
'sort_by': 'created'
}
)
change_log_entries = api_client.request(
'GET',
'change-log-entries',
params: {
'attributes' => ['type', 'document_types', 'document_type'],
'sort_by' => 'created'
}
)
{
"item_count": 3153,
"items": [
{
"_id": "66bfb4bb9ab4e3d6eb73480b",
"document_types": [
"AccountContact"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb73480d",
"document_types": [
"APIKey"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb73480f",
"document_types": [
"CustomTemplate"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb734811",
"document_types": [
"NominalCode"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb734813",
"document_types": [
"NominalCode"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb734815",
"document_types": [
"NominalCode"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb734817",
"document_types": [
"NominalCode"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb734819",
"document_types": [
"TaxRate"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb73481b",
"document_types": [
"TaxRate"
],
"type": "ADDED"
},
{
"_id": "66bfb4bb9ab4e3d6eb73481d",
"document_types": [
"TaxRate"
],
"type": "ADDED"
}
],
"page": 1,
"page_count": 316,
"per_page": 10
}
var changeLogEntry = apiClient.Request(
HttpMethod.Get,
$"change-log-entries/{changeLogEntryId}"
)
<?php
$change_log_entry = $api_client->request(
'GET',
'change-log-entries/' . $change_log_entry_id
);
change_log_entry = api_client(
'GET',
f'change-log-entries/{change_log_entry_id}'
)
change_log_entry = api_client.request(
'GET',
"change-log-entries/#{change_log_entry_id}"
)
{
"_id": "66bfb4bb9ab4e3d6eb73480b",
"created": "2024-08-16 20:21:15",
"details": null,
"document_types": [
"AccountContact"
],
"documents": [
"66bfb4bb9ab4e3d6eb73480a"
],
"type": "ADDED",
"user": "CareHQ demo builder"
}