curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
{
"_id": "5d75393ba28f9a17e1cb0f9e",
"created_at": "2019-09-08T17:24:11Z",
"last_message": "sure, I can wait",
"last_message_date_sent": 1567971414,
"last_message_id": "5d755856a0eb47411e0b72a9",
"last_message_user_id": 96753878,
"name": "New Year 2020 party",
"occupants_ids": [
96753878,
96754523,
96830631,
96831328,
96831397
],
"admin_ids": [],
"photo": "68123",
"type": 2,
"updated_at": "2019-09-08T19:36:54Z",
"user_id": 96753878,
"xmpp_room_jid": "76730_5d75393ba28f9a17e1cb0f9e@muc.chat.quickblox.com",
"unread_messages_count": 0,
"is_join_required": 1
}
{
"errors": [
"Users are already present in occupants_ids"
]
}
// If an invalid value is provided when modifying the is_join_required parameter
{
"errors": [
"Parameter \"is_join_required\" should be a number: either 0 or 1."
]
}
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
// If a user who is neither the account owner nor the dialog owner attempts to modify the is_join_required parameter
{
"errors": [
"You do not have permission to modify the \"is_join_required\" parameter."
]
}
{
"errors": [
"You don't have appropriate permissions to modify or delete \"admin_ids\". "
]
}
Update Dialog
Update a dialog.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
{
"_id": "5d75393ba28f9a17e1cb0f9e",
"created_at": "2019-09-08T17:24:11Z",
"last_message": "sure, I can wait",
"last_message_date_sent": 1567971414,
"last_message_id": "5d755856a0eb47411e0b72a9",
"last_message_user_id": 96753878,
"name": "New Year 2020 party",
"occupants_ids": [
96753878,
96754523,
96830631,
96831328,
96831397
],
"admin_ids": [],
"photo": "68123",
"type": 2,
"updated_at": "2019-09-08T19:36:54Z",
"user_id": 96753878,
"xmpp_room_jid": "76730_5d75393ba28f9a17e1cb0f9e@muc.chat.quickblox.com",
"unread_messages_count": 0,
"is_join_required": 1
}
{
"errors": [
"Users are already present in occupants_ids"
]
}
// If an invalid value is provided when modifying the is_join_required parameter
{
"errors": [
"Parameter \"is_join_required\" should be a number: either 0 or 1."
]
}
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
// If a user who is neither the account owner nor the dialog owner attempts to modify the is_join_required parameter
{
"errors": [
"You do not have permission to modify the \"is_join_required\" parameter."
]
}
{
"errors": [
"You don't have appropriate permissions to modify or delete \"admin_ids\". "
]
}
Recipes
Update dialog name
Update dialog name
1. Set a name of the dialog
name field for a group or public dialog only.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. As a result, the API returns a dialog with an updated name.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Add participants to the dialog
Add participants to the dialog
1. Append participants to the array with participants IDs
push_all operator to append participants to the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the participants that should be added to the dialog
occupants_ids array to add participants to the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. As a result, the API returns a dialog with new dialog participants.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Update custom data of the dialog
Update custom data of the dialog
1. Set a custom object that should be updated
data parameter to refer to a custom object that should be updated. The data stores data as a set of unique keys each having an associated value parameter.See this section to learn how to create a custom object class.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 8be2595b87f403f3c39e38fb39942cf481012bba" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
2. Set a name of the class
CoolDialog custom object class.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 8be2595b87f403f3c39e38fb39942cf481012bba" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
3. Specify custom object fields and their new values
Cooldialog class and set new values to these fields.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 8be2595b87f403f3c39e38fb39942cf481012bba" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
4. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 8be2595b87f403f3c39e38fb39942cf481012bba" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
5. As a result, the API returns a dialog with updated custom data.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 8be2595b87f403f3c39e38fb39942cf481012bba" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
Remove participants from dialog
Remove participants from dialog
1. Specify if you want to remove dialog participants
pull_all operator to remove participants from the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the participants that should be removed from the dialog
occupants_ids array to remove the participants from the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. As a result, the API returns a dialog with an updated 'occupants_ids' array list.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Update dialog name with API key
Update dialog name 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 '{
"name":"New Year 2024 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.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 '{
"name":"New Year 2024 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Set a name of the dialog
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"name":"New Year 2024 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"name":"New Year 2024 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
5. As a result, the API returns a dialog with an updated name.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"name":"New Year 2024 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Update dialog owner (added in v2.39.0)
Update dialog owner (added in v2.39.0)
1. Set user_id of the dialog
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. As a result, the API returns a dialog with an updated user_id.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Add admins to the dialog (added in v2.52.0)
Add admins to the dialog (added in v2.52.0)
1. Append admins to the array with participants IDs
push_all operator to append admins to the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the participants that should be added to the dialog
admin_ids array to add participants to the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. As a result, the API returns a dialog with new dialog admins.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Remove admins from dialog (added in v2.52.0)
Remove admins from dialog (added in v2.52.0)
1. Specify if you want to remove dialog admins
pull_all operator to remove admins from the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the admins that should be removed from the dialog
admin_ids array to remove the participants from the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. As a result, the API returns a dialog with an updated 'admin_ids' array list.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Add participants to the dialog with API key
Add participants to the dialog 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 '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.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 '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Append participants to the array with participants IDs
push_all operator to append participants to the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. Set the participants that should be added to the dialog
occupants_ids array to add participants to the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
5. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
6. As a result, the API returns a dialog with new dialog participants.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Remove participants from dialog with API key
Remove participants from dialog 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 '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.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 '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Specify if you want to remove dialog participants
pull_all operator to remove participants from the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. Set the participants that should be removed from the dialog
occupants_ids array to remove the participants from the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
5. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
6. As a result, the API returns a dialog with an updated 'occupants_ids' array list.
curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"occupants_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Update custom data of the dialog with API key
Update custom data of the dialog 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 '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.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 '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
3. Set a custom object that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
4. Set a name of the class
CoolDialog custom object class.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
5. Specify custom object fields and their new values
Cooldialog class and set new values to these fields.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
6. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
7. As a result, the API returns a dialog with updated custom data.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"data":{
"class_name":"CoolDialog",
"category":"co-workers",
"floor":"5",
"is_intern":"true",
"average_kpi":"0.8"
}
}' \
https://api.quickblox.com/chat/Dialog/5cc748eca0eb470d452adaaa.json
Update is_join_required parameter (added in v2.34.0)
Update is_join_required parameter (added in v2.34.0)
1. Set is_join_required value
is_join_required field for GROUP dialogs only (type=2).Possible values:0— join not required1— join required
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
"is_join_required": 0
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
"is_join_required": 0
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Result
is_join_required value.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
"is_join_required": 0
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Update dialog owner (added in v2.39.0)
Update dialog owner (added in v2.39.0)
1. Set user_id of the dialog
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
2. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. As a result, the API returns a dialog with an updated user_id.
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"user_id": 96753877
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Add admins to the dialog with API key (added in v2.52.0)
Add admins to the dialog with API key (added in v2.52.0)
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 '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.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 '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Append admins to the array with participants IDs
push_all operator to append admins to the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. Set the admins that should be added to the dialog
admin_ids array to add participants to the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
5. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
6. As a result, the API returns a dialog with new dialog admins.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"push_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
Remove admins from dialog with API key (added in v2.52.0)
Remove admins from dialog with API key (added in v2.52.0)
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 '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.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 '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
3. Specify if you want to remove dialog admins
pull_all operator to remove admins from the array with participants IDs.curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
4. Set the admins that should be removed from the dialog
admin_ids array to remove the participants from the dialog.curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
5. Set the ID of the dialog that should be updated
curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
6. As a result, the API returns a dialog with an updated 'admin_ids' array list.
curl -X PUT \
-H "Content-Type: application/json" \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-H 'On-Behalf-Of: 123' \
-d '{
"pull_all":{
"admin_ids":[
91375295,
96705448
]
}
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
type=3 (PRIVATE):
- Any user from
occupants_idscan update custom parameters.
type=2 (GROUP): Admin Support (introduced in v2.52.0)
-
Any user from
occupants_idscan add other users. -
Any user from
occupants_idscan remove only himself. -
Any user from
occupants_idscan update custom parameters. -
Dialog’s owner (creator) and admin can remove any users from
occupants_ids. -
Only dialog’s owner (creator) can add other users to
admin_ids. -
Only dialog’s owner (creator) can remove any users from
admin_ids. -
Admins can remove themselves from
admin_ids.
type=1 (PUBLIC_GROUP):
- Dialog’s owner (creator) and admin can update it.
-
Only dialog’s owner (creator) can add other users to
admin_ids. -
Only dialog’s owner (creator) can remove any users from
admin_ids. -
Admins can remove themselves from
admin_ids.
Path Parameters
Body Parameters
type=2 (GROUP).Possible values: 0 — join not required, 1 — join required. (added in v2.34.0).
Headers
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
200
200
400
400
403
403
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"name":"New Year 2020 party"
}' \
https://api.quickblox.com/chat/Dialog/5d75393ba28f9a17e1cb0f9e.json
{
"_id": "5d75393ba28f9a17e1cb0f9e",
"created_at": "2019-09-08T17:24:11Z",
"last_message": "sure, I can wait",
"last_message_date_sent": 1567971414,
"last_message_id": "5d755856a0eb47411e0b72a9",
"last_message_user_id": 96753878,
"name": "New Year 2020 party",
"occupants_ids": [
96753878,
96754523,
96830631,
96831328,
96831397
],
"admin_ids": [],
"photo": "68123",
"type": 2,
"updated_at": "2019-09-08T19:36:54Z",
"user_id": 96753878,
"xmpp_room_jid": "76730_5d75393ba28f9a17e1cb0f9e@muc.chat.quickblox.com",
"unread_messages_count": 0,
"is_join_required": 1
}
{
"errors": [
"Users are already present in occupants_ids"
]
}
// If an invalid value is provided when modifying the is_join_required parameter
{
"errors": [
"Parameter \"is_join_required\" should be a number: either 0 or 1."
]
}
{
"errors": [
"You don't have appropriate permissions to perform this operation"
]
}
// If a user who is neither the account owner nor the dialog owner attempts to modify the is_join_required parameter
{
"errors": [
"You do not have permission to modify the \"is_join_required\" parameter."
]
}
{
"errors": [
"You don't have appropriate permissions to modify or delete \"admin_ids\". "
]
}
Was this page helpful?