curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Empty body
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
{
"errors": [
"The resource wasn't found"
]
}
Update Message
Update a dialog message.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Empty body
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
{
"errors": [
"The resource wasn't found"
]
}
Recipes
Mark messages as delivered
Mark messages as delivered
1. Specify if you want to mark messages as delivered
delivered parameter to 1 to mark all messages as delivered.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Set the ID of the dialog
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as delivered.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Update message text
Update message text
1. Type an updated message
message parameter.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Set the ID of the dialog
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. Set the ID of the message
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
4. As a result, the API returns '200 OK' status code which implies that the message was successfully updated.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Mark messages as read
Mark messages as read
1. Specify if you want to mark messages as read.
read parameter to 1 to mark all messages as read.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Set the ID of the dialog.
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as read.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Mark messages as delivered with API key
Mark messages as delivered with API key
1. Use 'Authorization' header to pass API key
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Use 'On-Behalf-Of' header to pass user id
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. Specify if you want to mark messages as delivered
delivered parameter to 1 to mark all messages as delivered.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
4. Set the ID of the dialog
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
5. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as delivered.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Update message text with API key
Update message text with API key
1. Use 'Authorization' header to pass API key
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Use 'On-Behalf-Of' header to pass user id
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. Type an updated message
message parameter.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
4. Set the ID of the dialog
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
5. Set the ID of the message
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
6. As a result, the API returns '200 OK' status code which implies that the message was successfully updated.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"message":"updated message",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Mark messages as read with API key
Mark messages as read with API key
1. Use 'Authorization' header to pass API key
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
2. Use 'On-Behalf-Of' header to pass user id
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
3. Specify if you want to mark messages as read
read parameter to 1 to mark all messages as read.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
4. Set the ID of the dialog.
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
5. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as read.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Mark all messages as read
Mark all messages as read
1. Specify if you want to mark messages as read.
read parameter to 1 to mark all messages as read.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
2. Set the ID of the dialog.
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
3. Don't set any message ID to the path
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
4. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as read.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
Mark all messages as delivered
Mark all messages as delivered
1. Specify if you want to mark messages as delivered
delivered parameter to 1 to mark all messages as delivered.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
2. Set the ID of the dialog
chat_dialog_id to refer to a specific dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
3. Don't set any message ID to the path
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
4. As a result, the API retuns a '200 OK' status code which implies that all messages of the specified dialog were marked as delivered.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"delivered":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message.json
Path Parameters
Body Parameters
read=1 to perform. As a result, the user ID is added to the array of read_ids field. See the Messages model for more details. delivered=1 to perform. As a result, the user ID is added to the array of delivered_ids field. See the Messages model for more details. Headers
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"read":"1",
"chat_dialog_id":"53a99a7be4b094c7c6d31b41"
}' \
https://api.quickblox.com/chat/Message/53aabe15e4b077ddd43e7fd3.json
Empty body
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
{
"errors": [
"The resource wasn't found"
]
}
Was this page helpful?