Recipes
Mark messages as delivered
1. Specify if you want to mark messages as delivered
Set a 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
Set a 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
1. Type an updated message
Enter an updated message text using the 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
Set a 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
Set the ID of the message to refer to a particular 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
1. Specify if you want to mark messages as read.
Set a 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.
Set the 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
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
To execute a request on behalf of a specific user
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
Set a 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
Set a 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
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
To execute a request on behalf of a specific user
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
Enter an updated message text using the 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
Set a 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
Set the ID of the message to refer to a particular 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
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
To execute a request on behalf of a specific user.
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
Set a 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.
Set the 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
1. Specify if you want to mark messages as read.
Set a 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.
Set the 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
To mark all messages of specified dialog as read keep the path without message ID
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
1. Specify if you want to mark messages as delivered
Set a 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
Set a 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
To mark all messages of specified dialog as delivered keep the path without message ID
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
ID of the message. Generated automatically by the server after message creation.
Body Parameters
Update a message status to read. Set
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.
Update a message status to delivered. Set
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.
ID of the dialog containing a message for update.
A user or application session token. See
Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Authorization
string
default: "ApiKey {your_api_key}"
API key from Dashboard. Expected format: ApiKey {your_api_key}
. Must be used either QB-Token or Authorization.
User ID. The user ID of the user on whose behalf the request is being made.
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