curl --request GET \
--url https://{appid}.api-{region}.cometchat.io/v3/messages/{id} \
--header 'apikey: <api-key>'
{
"data": {
"id": "1",
"conversationId": "superhero3_user_superhero5",
"sender": "superhero3",
"receiverType": "user",
"receiver": "superhero5",
"category": "message",
"type": "text",
"data": {
"text": "test hello",
"metadata": {
"key1": "val1"
},
"entities": {
"sender": {
"entity": {
"uid": "superhero3",
"name": "Spiderman",
"avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png",
"status": "offline",
"role": "default",
"createdAt": 1638361550
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero5",
"name": "Cyclops",
"avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png",
"status": "offline",
"role": "default",
"createdAt": 1638361550,
"conversationId": "superhero3_user_superhero5"
},
"entityType": "user"
}
}
},
"sentAt": 1638423490,
"updatedAt": 1638423490
}
}
Fetches the details of a message.
curl --request GET \
--url https://{appid}.api-{region}.cometchat.io/v3/messages/{id} \
--header 'apikey: <api-key>'
{
"data": {
"id": "1",
"conversationId": "superhero3_user_superhero5",
"sender": "superhero3",
"receiverType": "user",
"receiver": "superhero5",
"category": "message",
"type": "text",
"data": {
"text": "test hello",
"metadata": {
"key1": "val1"
},
"entities": {
"sender": {
"entity": {
"uid": "superhero3",
"name": "Spiderman",
"avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png",
"status": "offline",
"role": "default",
"createdAt": 1638361550
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero5",
"name": "Cyclops",
"avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png",
"status": "offline",
"role": "default",
"createdAt": 1638361550,
"conversationId": "superhero3_user_superhero5"
},
"entityType": "user"
}
}
},
"sentAt": 1638423490,
"updatedAt": 1638423490
}
}
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
UID of the user on whose behalf the action is performed.
Id of the message whose details are to be fetched.
Retreived Message
The response is of type object
.
Was this page helpful?