latestSwagger 2.02026-08-101561322.2 MB
3e4029d19684
Chats
Get chat messages
<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Chats/getChatMessages" target="_blank">Try in sandbox</a><br>
get/api/v2/chats/{id}/message
Path parameters
idinteger required
Query parameters
pageinteger
Fetch specified results page.
limitinteger
The number of results per page.
querystring
Find messages by specified search query.
startstring
Return messages since specified timestamp only. Required when end parameter specified.
endstring
Return messages up to specified timestamp only. Required when start parameter specified.
direction'asc' | 'desc'
Order direction. Default is desc.
voice0 | 1
Fetch results with voice calls.
includeNotes0 | 1
Fetch results with messenger notes.
Response
Returned when successful.
Example response
{
"page": 1,
"pageCount": 10,
"limit": 10,
"resources": [
{
"id": 1,
"direction": "in",
"messageTime": "2012-11-28T18:38:28+0000",
"text": "This is a sample message",
"status": "d",
"firstName": "Charles",
"lastName": "Conway",
"type": "text",
"chatType": "text",
"errorCode": "test_error_code",
"files": [
{
"name": "image-66aba1bc787b40.51413958.png",
"originalName": "image.png",
"mimeType": "image/png",
"size": 1024,
"type": "text",
"previewUrl": "https://example.com/image-preview.jpg",
"url": "https://example.com/image.png",
"metadata": {
"type": "text",
"height": 1024,
"width": 1024,
"preview": {
"height": 1024,
"width": 1024
}
}
}
],
"payload": {
"type": "story_reply",
"mediaPreview": "https://example.com/preview.jpg"
},
"avatar": "avatars/dummy_avatar.png"
}
]
}