Get Message List
Retrieve a list of messages for a given room.
Request
GET https://api.meetinglawyers.com/chat/message
Headers
| Name | Value |
|---|---|
Api-Key | Integration identifier provided by MeetingLawyers |
Authorization | Bearer token in JWT format retrieved from User Authenticate |
Accept | application/json |
Query string parameters
| Name | Type | Value |
|---|---|---|
room | Integer | Room id |
pivot | String | Message id which will be used as the offset |
limit | Integer | Number of messages to be retrieved |
older | Boolean | true: Retrieve limit messages older than pivot onefalse: Retrieve limit messages newer than pivot one |
Response
Returns an array of Message entities with all information needed for its rendering.
Message entity
| Name | Type | Value |
|---|---|---|
from_user_id | String | Sender user unique identifier |
to_user_id | String | Receiver user unique identifier |
room_id | Integer | Room id |
message_id | String | Message standard universal unique identifier (UUID) |
status | String | Supported statuses: sent, received, read |
type | String | Current types supported: text, image, file |
text | String | Required if type is text |
image_url | String | Required if type is image |
image_thumb_url | String | Required if type is image |
image_width | String | Required if type is image |
image_height | String | Required if type is image |
file_url | String | Required if type is file |
file_name | String | Required if type is file |
file_size | String | File size in KB Required if type is file |
created_at | String | Message creation timestamp in UTC |
Example
Request
curl
--header 'Accept: application/json'
--header 'Api-Key: g3f2fh675l0x'
--header 'Authorization: Bearer dXNlcm5hbWU6MTIzNDU2Nzg5MDEyMzQ1N...'
'https://api.meetinglawyers.com/chat/message?room=34234&pivot=285c3d07-9b63-41e0-829f-5d51b31ffd29&limit=100&older&older=true'
Response
[
{
"from_user_id": "accec968-ec81-4af7-accb-e0e32e09fb26",
"to_user_id": "285c3d07-9b63-41e0-829f-5d51b31ffd29",
"room_id": 34625,
"message_id": "ba7af057-d031-4933-a033-75ddcfb3b260",
"status": "sent",
"type": "text",
"text": "Te paso una foto y un archivo",
"created_at": "2021-08-01T07:12:23"
},
{
"from_user_id": "accec968-ec81-4af7-accb-e0e32e09fb26",
"to_user_id": "285c3d07-9b63-41e0-829f-5d51b31ffd29",
"room_id": 34625,
"message_id": "cad941bf-27f7-43a9-bb99-d618a7cc6f85",
"status": "sent",
"type": "image",
"image_url": "https://ml-bucket.s3.amazonaws.com/media/4576345.png",
"image_thumb_url": "https://ml-bucket.s3.amazonaws.com/media/4576345t.png",
"image_width": "1024",
"image_height": "512",
"created_at": "2021-08-01T07:12:41"
},
{
"from_user_id": "accec968-ec81-4af7-accb-e0e32e09fb26",
"to_user_id": "285c3d07-9b63-41e0-829f-5d51b31ffd29",
"room_id": 34625,
"message_id": "eb1707cd-1f61-4fe1-a96c-d109628dc28c",
"status": "sent",
"type": "file",
"file_url": "https://ml-bucket.s3.amazonaws.com/media/83746234.pdf",
"file_name": "sample.pdf",
"file_size": "92",
"created_at": "2021-08-01T07:13:12"
}
]