Search Messages: /message/search (GET)
Purpose:
Retrieve the first ten messages based on content, user id, and channel/user.
Input:
- Headers:
- Authorization: The JWT token of the user.
- Query Parameters:
- content: (Optional, String) The content of the message.
- user_id: (Optional, Uuid) The id of the user.
- recipient_type: (String) The type of the recipient. Set to “CHANNEL” if channel, or “USER” if user.
- reference_id: (Uuid) This should be the user or channel id based on the recipient type.
Output (200):
[
{
"id": "7fe0c4ee-5de1-41f1-be41-8658957c510b",
"message_type": "MESSAGE",
"recipient_type": "CHANNEL",
"reference_id": "1568536b-0e5a-4605-bf56-18fccd73f862",
"content": "Hello, world!",
"date_created": "2024-08-12T12:34:56",
"date_updated": "2024-08-12T12:34:56",
"user_id": "33505151-e25f-4adc-a6aa-964190112af8",
"deleted": false
},
{
"id": "da032ee6-bad0-4f08-9841-01480e493051",
"message_type": "MESSAGE",
"recipient_type": "CHANNEL",
"reference_id": "e84f82f5-930d-4c26-b33c-9da4f99b921a",
"content": "Hello, planet!",
"date_created": "2024-08-12T12:35:56",
"date_updated": "2024-08-12T12:35:56",
"user_id": "33505151-e25f-4adc-a6aa-964190112af8",
"deleted": false
}
]