A message sent or received via the CRM.
Received messages are associated with a location based on the email address or VMN (virtual mobile number) they were received via. Where possible they are then associated with a care seeker, service user (and potentially a service user key contact) or location contact.
A unique Id for the message.
Date/time flag indicating when (if) the message's details were anonymized.
The Id of the care enquiry this message relates to.
The channel the message was sent or received over; email, sms.
The compiled content of the message.
The name and email address of the person being corresponded with.
The date/time the message was created.
The date/time the message was sent or received.
The message delivery status (only applicable to messages sent via the application, based on the response from the sender service; sent, failed, queued, unknown.
The email address or telephone number that the message was sent to.
The direction of the message; inbound, outbound.
An Id used to associated the message with a download.
The service used to send or relay the message.
A list of Ids for invoices sent with the email (invoices are attached as PDFs).
A list of Ids for literature items sent with the email.
A list of Ids for the literature items the recipient has downloaded by the recipient of the email.
The Id of the location this message relates to.
The Id of the location contact this message relates to.
The date/time the group was modified.
The email address or telephone number that the message originates from.
Date/time flag indicating when the message was marked as read.
The Id of the user that flagged the message as read.
The Id of the user that this message is in reply to.
Date/Time flag indicating when the issue against message was set as resolved.
The Id of the user that flagged the message as resolved.
The Id of the user the message was sent by.
The Id of the service user this message relates to.
The Id of the service user contact this message relates to.
The subject of the message (if sending/receiving an email).
A list of tags assigned to the message.
An Id used to associated the message with a other messages in a thread.
{
"_id": "6724fbcb4f73a2cebf638860",
"anonymized": null,
"care_enquiry": "6724fbca4f73a2cebf63858e",
"channel": "email",
"content": "Dear Gordon,\n\nIt was lovely to speak to you earlier, please find a link below to download the brochure for Douglas Court. There's lots of information in the brochure but if you have any further questions please don't hesitate to get in touch.\n\nBest regards,\n\nMark Walford / Owner\n",
"correspondent": "Gordon Parker gordon.parker@ee.co.uk",
"created": "2024-11-01 16:03:23",
"date_time": "2024-10-29 13:00:00",
"delivery_status": "sent",
"destination": "gordon.parker@ee.co.uk",
"direction": "outbound",
"download_id": "912195de-8455-4242-89f5-8fe6fff8fb9a",
"external_service": "oakridge",
"invoices": null,
"literature_items": [
"6724fbc74f73a2cebf63780c"
],
"literature_items_downloaded": [],
"location": "6724fbc74f73a2cebf6377fa",
"location_contact": null,
"modified": "2024-11-01 16:03:23",
"origin": "demo@marshallcare.carehq.co.uk",
"read": null,
"read_by": null,
"reply_to": null,
"resolved": null,
"resolved_by": null,
"sent_by": "6724fbc74f73a2cebf637806",
"service_user": null,
"service_user_contact": null,
"subject": "Douglas Court brochure",
"tags": [],
"thread_id": null
}
Return a list of messages.
['_id']
A list of attributes to include for fetched objects.
unset
A filter that allows messages to be filtered by whether the message is anonymized.
A filter that accepts a list of care enquiry Ids and filters messages to those where the receipient or sender is one of the care enquiries.
A filter that accepts a list of delivery statuses and filters messages by the channel they were sent through.
A filter that accepts a list of delivery statuses and filters messages by the status of their delivery.
A filter that allows messages to be filtered by the direction messages were sent in.
A filter that accepts a date and filters messages to those sent or received 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 messages by the location they were received for.
A filter that accepts a list of location contact Ids and filters messages to those where the receipient or sender is one of the location contacts.
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; correspondent, destination, origin.
unset
A filter that allows messages to be filtered by whether the message is flagged as having been read.
A filter that accepts a list of user Ids and filters messages to those in reply to one of the users.
A filter that accepts a list of user Ids and filters messages to those sent by one of the users.
A filter that accepts a list of service user Ids and filters messages to those where the receipient or sender is one of the service users.
A filter that accepts a list of service user contact Ids and filters messages to those where the receipient or sender is one of the service user contacts.
A filter that accepts a date and filters messages to those sent or received 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 messages.
var messages = apiClient.Request(
HttpMethod.Get,
"messages",
new MultiValueDict()
.Add("attributes", "content", "correspondent", "date_time")
.Add("filters-channel", "sms")
.Add("filters-direction", "inbound")
.Add("sort_by", "date_time")
);
<?php
$messages = $api_client->request(
'GET',
'messages',
[
'attributes'=>['content', 'correspondent', 'date_time'],
'filters-channel'=>['sms'],
'filters-direction'=>['inbound'],
'sort_by'=>'date_time'
]
);
messages = api_client(
'GET',
'messages',
params={
'attributes': ['content', 'correspondent', 'date_time'],
'filters-channel': ['sms'],
'sort_by': 'date_time'
}
)
messages = api_client.request(
'GET',
'messages',
params: {
'attributes' => ['content', 'correspondent', 'date_time'],
'filters-channel' => ['sms'],
'filters-direction' => ['inbound'],
'sort_by' => 'date_time'
}
)
{
"item_count": 1,
"items": [
{
"_id": "6724fbcb4f73a2cebf638864",
"content": "Hi Jason, this is Mark from Marshall Care, I know you normally pop into see your grandmother on the weekend so I just wanted to let you know she's having her hair cut Saturday between 2pm-4pm.",
"correspondent": "Justin Wall +447790483280",
"date_time": "2024-10-03 11:06:00"
}
],
"page": 1,
"page_count": 1,
"per_page": 10
}
var message = apiClient.Request(HttpMessage.Get, $"messages/{messageId}");
<?php
$message = $api_client->request('GET', 'messages/' . $message_id);
message = api_client('GET', f'messages/{message_id}')
message = api_client.request('GET', "messages/#{message_id}")
{
"_id": "6724fbcb4f73a2cebf638860",
"anonymized": null,
"care_enquiry": "6724fbca4f73a2cebf63858e",
"channel": "email",
"content": "Dear Gordon,\n\nIt was lovely to speak to you earlier, please find a link below to download the brochure for Douglas Court. There's lots of information in the brochure but if you have any further questions please don't hesitate to get in touch.\n\nBest regards,\n\nMark Walford / Owner\n",
"correspondent": "Gordon Parker gordon.parker@ee.co.uk",
"created": "2024-11-01 16:03:23",
"date_time": "2024-10-29 13:00:00",
"delivery_status": "sent",
"destination": "gordon.parker@ee.co.uk",
"direction": "outbound",
"download_id": "912195de-8455-4242-89f5-8fe6fff8fb9a",
"external_service": "oakridge",
"invoices": null,
"literature_items": [
"6724fbc74f73a2cebf63780c"
],
"literature_items_downloaded": [],
"location": "6724fbc74f73a2cebf6377fa",
"location_contact": null,
"modified": "2024-11-01 16:03:23",
"origin": "demo@marshallcare.carehq.co.uk",
"read": null,
"read_by": null,
"reply_to": null,
"resolved": null,
"resolved_by": null,
"sent_by": "6724fbc74f73a2cebf637806",
"service_user": null,
"service_user_contact": null,
"subject": "Douglas Court brochure",
"tags": [],
"thread_id": null
}