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": "66bfb4c19ab4e3d6eb735958",
"anonymized": null,
"care_enquiry": "66bfb4c09ab4e3d6eb735694",
"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-08-16 20:21:21",
"location": "66bfb4bb9ab4e3d6eb734900",
"modified": "2024-08-16 20:21:21",
"pinned": true,
"service_user": null,
"user": "66bfb4bb9ab4e3d6eb73490c",
"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": "66bfb4d8c3d53f8d1dead14f",
"care_enquiry": "66bfb4d89ab4e3d6eb736004",
"comment": "Bob was a keen gardener before his fall and would like a ground floor room that has views of the gardens.",
"created": "2024-08-16 20:21:44",
"location": "66bfb4bb9ab4e3d6eb734900",
"modified": "2024-08-16 20:21:44",
"pinned": true,
"service_user": null,
"user_sticky_label": "CareHQ API: Demo (66bfb4bb9ab4e3d6eb73480c)"
}
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": "66bfb4c19ab4e3d6eb73595a",
"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": "66bfb4c19ab4e3d6eb735958",
"anonymized": null,
"care_enquiry": "66bfb4c09ab4e3d6eb735694",
"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-08-16 20:21:21",
"location": "66bfb4bb9ab4e3d6eb734900",
"modified": "2024-08-16 20:21:21",
"pinned": true,
"service_user": null,
"user": "66bfb4bb9ab4e3d6eb73490c",
"user_sticky_label": "Mark Walford"
}