Skip to main content

Get Message List

Retrieve a list of messages for a given room.

Request

GET https://api.meetinglawyers.com/chat/message

Headers

NameValue
Api-KeyIntegration identifier provided by MeetingLawyers
AuthorizationBearer token in JWT format retrieved from User Authenticate
Acceptapplication/json

Query string parameters

NameTypeValue
roomIntegerRoom id
pivotStringMessage id which will be used as the offset
limitIntegerNumber of messages to be retrieved
olderBooleantrue: Retrieve limit messages older than pivot one
false: Retrieve limit messages newer than pivot one

Response

Returns an array of Message entities with all information needed for its rendering.

Message entity

NameTypeValue
from_user_idStringSender user unique identifier
to_user_idStringReceiver user unique identifier
room_idIntegerRoom id
message_idStringMessage standard universal unique identifier (UUID)
statusStringSupported statuses: sent, received, read
typeStringCurrent types supported: text, image, file
textStringRequired if type is text
image_urlStringRequired if type is image
image_thumb_urlStringRequired if type is image
image_widthStringRequired if type is image
image_heightStringRequired if type is image
file_urlStringRequired if type is file
file_nameStringRequired if type is file
file_sizeStringFile size in KB
Required if type is file
created_atStringMessage 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"
}
]