Chat Info

To retreive the current user chats by chat id or topic id.

info

{api-base-url} can be obtained from the MirrorFly console.

HTTP request#

curl -X GET "https://{api-base-url}/api/v1/chat/details?chatId=xxxx&topicId=xxxx&page=1&size=10"
-H "accept: */*"
-H "Authorization: AuthToken"

Request Params#

ParamDataTypeRequiredDescription
chatIdStringNoRepresents a unique identifier for a direct chat between two users
topicIdStringNoRepresents a unique identifier that maps a collection of chats under a specific topic
pageNumberNoPage number to get the particular page data default value is 1
sizeNumberNoNumber of users per page default value is 10

Responses#

If successful, this action returns call logs in the response body.

{
"status": 200,
"data": {
"chatList": [
{
"id": 0, //Number - unique id for this record
"fromUser": "xxxxx", // String - Sender userid
"toUser": "xxxxx", // String - Receiver userid
"participant": "xxxxxx", // String - Participant userid or groupid of chat
"chatType": "samplechattype", // String - Possible values are singlechat, groupchat
"messageType": "samplemessagetype", // String - Message type such as text, image, file, audio, video, contact, location, notification
"messageId": "xxxxx", // String - Unique id of this message
"sentTime": "dd/mm/yyyy hh:mm:ss", // String - Message sent time
"unread": 0, // Number - unread messages count
"messageNotification": 0,
"topicId": "xxxxxx", // String - topicId
"messageTime": 0, // Number - sentTime as epoch timestamp
"metaData": {
"key": "value"
},
"jid": "99xxxxxx11", // String - Jid of the logged-in user
}
],
"totalPages": 1,
"totalRecords": 1
},
"message": "Data retrieved successfully"
}

Error#

In the case of an error, an error object like below is returned.

When the token passed in Headers is not given or expired

{
"status": 401,
"message": "Token Expired"
}

In the case of a Bad Request, an error message is returned

{
"status": 400,
"message": "Error Message"
}