curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
{
"notifications": {
"enabled": 0
}
}
{
"errors": [
"Incorrect params."
]
}
Chat
Update Notification Settings
Update dialog notification settings for current user.
PUT
/
chat
/
Dialog
/
{chat_dialog_id}
/
notifications.json
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-Token: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
{
"notifications": {
"enabled": 0
}
}
{
"errors": [
"Incorrect params."
]
}
Recipes
Update Notification Settings with API key
Update Notification Settings with API key
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 '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.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 '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
3
3. Set settings
“enabled”: 0 - turn off the push notifications for specified dialog
“enabled”: 1 - turn off the push notifications for specified dialog
“enabled”: 1 - turn off the push notifications for specified dialog
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
4
4. Set dialog ID
Specify the ID of the dialog whose setting status you want to update.
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
5
5. As result, the API returns updated notification settings status
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-H "On-Behalf-Of: 123" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
type=2 (GROUP) and type=3 (PRIVATE).
Path Parameters
string
required
ID of the dialog to which a current message is connected. Generated automatically by the server after message creation
Body Parameters
integer
Possible values are:
enabled=0, enabled=1. Headers
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.
string
default:"ApiKey {your_api_key}"
API key from Dashboard. Expected format:
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.string
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: 1319b4991186601ccf4df2d0fa89565f68012bba" \
-d '{
"enabled":0
}' \
https://api.quickblox.com/chat/Dialog/5d75651fa0eb4732190b72aa/notifications.json
{
"notifications": {
"enabled": 0
}
}
{
"errors": [
"Incorrect params."
]
}
Was this page helpful?