Skip to main content
PUT
/
chat
/
Message
/
{chat_message_id}
.json
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

Recipes

1

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

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

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

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

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

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

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

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

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

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
1

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

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

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

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

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
1

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

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

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

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

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

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
1

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

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

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

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

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
1

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

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

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

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
1

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

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

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

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

chat_message_id
string
ID of the message. Generated automatically by the server after message creation.

Body Parameters

read
integer
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.
delivered
integer
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.
message
string
Update message’s text.
chat_dialog_id
string
required
ID of the dialog containing a message for update.

Headers

QB-Token
string
required
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.
On-Behalf-Of
string
User ID. The user ID of the user on whose behalf the request is being made.

Responses

A successful response
An error response
errors
array of strings
An error response
errors
array of strings
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
I