A comment/update posted against a care enquiry or service user.
A unique Id for the comment.
The date/time the comment was anonymized (if anonymized).
The care enquiry the comment was posted against.
The body of the comment.
The date/time the comment was created.
The Id of the location this comment relates to.
The date/time the comment was created.
Flag indicating if the comment should appear (pinned) on the details page for the associated care enquiry / service user.
The service user the comment was posted against.
The user that posted the comment.
A snapshot of the name of the user that posted the comment, used for scenarios where no user posted the comment or the user that posted the comment has been removed from CareHQ.
{
"_id": "6724fbcb4f73a2cebf638852",
"anonymized": null,
"care_enquiry": "6724fbca4f73a2cebf63858e",
"comment": "Gordon has asked us to give him a call in 3 weeks as his sister is about to go into hospital for a minor operation and he would like to be able to visit the home with her when she is well enough.\n",
"created": "2024-11-01 16:03:23",
"location": "6724fbc74f73a2cebf6377fa",
"modified": "2024-11-01 16:03:23",
"pinned": true,
"service_user": null,
"user": "6724fbc74f73a2cebf637806",
"user_sticky_label": "Mark Walford"
}
The Id of the care enquiry the comment relates to.
The body of the comment.
A flag indicating if the comment should appear (pinned) on the details page for the associated care enquiry / service user.
The Id of the service user the comment relates to.
The Id of user posting the comment. If you do not specify a user then comment will be marked as posted by the API.
Returns the comment object created.
var comment = apiClient.Request(
HttpMethod.Put,
"comments",
null,
new MultiValueDict()
.Add("care_enquiry", careEnquiryId)
.Add(
"comment",
"Bob was a keen gardener before his and would " +
"like a ground floor room that has views of the gardens."
)
.Add("pinned", true)
);
<?php
$comment = $api_client->request(
'PUT',
'comments',
NULL
[
'care_enquiry'=>care_enquiry_id,
'comment'=>'Bob was a keen gardener before his fall and would '
. 'like a ground floor room that has views of the gardens.',
'pinned'=>True
]
);
comment = api_client(
'PUT',
'comments',
data={
'care_enquiry': care_enquiry_id,
'comment': (
'Bob was a keen gardener before his fall and would like a '
'ground floor room that has views of the gardens.'
),
'pinned': True
}
)
comment = api_client.request(
'PUT',
'comments',
data: {
'care_enquiry' => care_enquiry_id,
'comment' => 'Bob was a keen gardener before his fall and would ' +
'like a ground floor room that has views of the gardens.'
),
'pinned' => true
}
)
{
"_id": "6724fbd53cd2cde34170f2bc",
"care_enquiry": "6724fbd54f73a2cebf638f1d",
"comment": "Bob was a keen gardener before his fall and would like a ground floor room that has views of the gardens.",
"created": "2024-11-01 16:03:33",
"location": "6724fbc74f73a2cebf6377fa",
"modified": "2024-11-01 16:03:33",
"pinned": true,
"service_user": null,
"user_sticky_label": "CareHQ API: Demo (6724fbc74f73a2cebf6376fc)"
}
Return a list of comments.
['_id']
A list of attributes to include for fetched objects.
unset
A filter that allows comments to be filtered by whether the comment is anonymized.
A filter that accepts a list of care enquiry Ids and filters comments by the enquiry the comments are posted against.
A filter that accepts a date and filters comments to those posted before or on the end 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 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.
unset
A filter that allows comments to be filtered by whether the comment is pinned.
A case insensitive keyword filter applied to the following fields; comment.
A filter that accepts a list of service user Ids and filters comments by the service user the comments are posted against.
A filter that accepts a date and filters comments to those posted after or on the start date.
A filter that accepts a list of user Ids and filters comments by the user that posted them.
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 comments.
var comments = apiClient.Request(
HttpMethod.Get,
"comments",
new MultiValueDict()
.Add("attributes", "comment")
.Add("filters-q", "coffee")
);
<?php
$comments = $api_client->request(
'GET',
'comments',
[
'attributes'=>['comment'],
'filters-q'=>'coffee'
]
);
comments = api_client(
'GET',
'comments',
params={
'attributes': ['comment'],
'filters-q': 'coffee'
}
)
comments = api_client.request(
'GET',
'comments',
params: {
'attributes' => ['comment'],
'filters-q' => 'coffee'
}
)
{
"item_count": 1,
"items": [
{
"_id": "6724fbcb4f73a2cebf638854",
"comment": "Anna's Gransdson Justin visits most weekends (coffee black + 1 sugar).\n\nSometimes Anna get's confused with the days and will ask what time he's comming, if she gets really agitated calling Justin so she can talk to him helps to calm her.\n"
}
],
"page": 1,
"page_count": 1,
"per_page": 10
}
var comment = apiClient.Request(HttpMethod.Get, $"comments/{commentId}");
<?php
$comment = $api_client->request('GET', 'comments/' . $comment_id);
comment = api_client('GET', f'comments/{comment_id}')
comment = api_client.request('GET', "comments/#{comment_id}")
{
"_id": "6724fbcb4f73a2cebf638852",
"anonymized": null,
"care_enquiry": "6724fbca4f73a2cebf63858e",
"comment": "Gordon has asked us to give him a call in 3 weeks as his sister is about to go into hospital for a minor operation and he would like to be able to visit the home with her when she is well enough.\n",
"created": "2024-11-01 16:03:23",
"location": "6724fbc74f73a2cebf6377fa",
"modified": "2024-11-01 16:03:23",
"pinned": true,
"service_user": null,
"user": "6724fbc74f73a2cebf637806",
"user_sticky_label": "Mark Walford"
}