note that %21RotqTsIrBvXaPAbhiC%3Atwkl.chat
is the room_id
after url encoding it using this tool
curl --location --request PUT 'http://localhost:8008/_matrix/client/r0/pushrules/global/room/%21RotqTsIrBvXaPAbhiC%3Atwkl.chat' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <user_token>' \
--data '{
"actions": [
{
"set_tweak": "highlight",
"value": false
},
{
"set_tweak": "sound",
"value": "default"
},
"notify"
]
}'
curl --location 'http://localhost:8008/_matrix/client/r0/notifications' \
--header 'Authorization: Bearer <user_token>'
{
"notifications": [
{
"room_id": "!RotqTsIrBvXaPAbhiC:twkl.chat",
"profile_tag": null,
"actions": [
{
"set_tweak": "highlight",
"value": false
},
{
"set_tweak": "sound",
"value": "default"
},
"notify"
],
"ts": 1724324689536,
"event": {
"type": "m.room.message",
"sender": "@admin:twkl.chat",
"content": {
"msgtype": "m.text",
"body": "bye"
},
"origin_server_ts": 1724324689451,
"unsigned": {
"age": 19877
},
"event_id": "$30gljAwSjcRhYTop57KzK-tXxDx7lpK3tw2YO8vyYDM"
},
"read": false
}
],
"next_token": "92"
}
note that %21RotqTsIrBvXaPAbhiC%3Atwkl.chat
is the room_id
after url encoding it using this tool
curl --location --request PUT 'http://localhost:8008/_matrix/client/r0/pushrules/global/room/%21RotqTsIrBvXaPAbhiC%3Atwkl.chat' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <user_token>' \
--data '{
"actions": [
"dont_notify"
]
}'
curl --location 'http://localhost:8008/_matrix/client/r0/notifications' \
--header 'Authorization: Bearer <user_token>'
{
"notifications": [],
"next_token": null
}
curl --location 'http://localhost:8008/_matrix/client/r0/rooms/!RotqTsIrBvXaPAbhiC:twkl.chat/send/m.room.message' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <entity_token>' \
--data '{
"msgtype": "m.text",
"body": "hello, world!"
}'
result: the user who sat the room to dont_notify will not get a push notification or a sound that indicates a new message.
note that %21RotqTsIrBvXaPAbhiC%3Atwkl.chat
is the room_id
after url encoding it using this tool
curl --location --request DELETE 'http://localhost:8008/_matrix/client/r0/pushrules/global/room/%21RotqTsIrBvXaPAbhiC%3Atwkl.chat' \
--header 'Authorization: Bearer <user_token>'
curl --location 'http://localhost:8008/_matrix/client/v3/sync?filter=0&timeout=30000&since=s100_584_0_65_100_73_1_72_0_1' \
--header 'Authorization: Bearer <user_token>'
{
"next_batch": "s104_597_0_67_104_73_1_75_0_1",
"account_data": {
"events": [
{
"type": "im.vector.setting.breadcrumbs",
"content": {
"recent_rooms": [
"!RotqTsIrBvXaPAbhiC:twkl.chat",
"!EgpyACdjjXWIzMDTSd:twkl.chat",
"!orRoqZTnBbAfUsQlSt:twkl.chat"
]
}
},
{
"type": "org.matrix.msc3890.local_notification_settings.FQUBGKTJMA",
"content": {
"is_silenced": false
}
}
]
},
"presence": {
"events": [
{
"type": "m.presence",
"sender": "@rahaf:twkl.chat",
"content": {
"presence": "online",
"last_active_ago": 24,
"currently_active": true
}
},
{
"type": "m.presence",
"sender": "@admin:twkl.chat",
"content": {
"presence": "offline",
"last_active_ago": 38900
}
}
]
},
"device_lists": {
"changed": [
"@rahaf:twkl.chat"
]
},
"device_one_time_keys_count": {
"signed_curve25519": 0
},
"org.matrix.msc2732.device_unused_fallback_key_types": [],
"device_unused_fallback_key_types": [],
"rooms": {
"join": {
"!RotqTsIrBvXaPAbhiC:twkl.chat": {
"timeline": {
"events": [
{
"type": "m.room.message",
"sender": "@admin:twkl.chat",
"content": {
"msgtype": "m.text",
"body": "bye"
},
"origin_server_ts": 1724338492441,
"unsigned": {
"age": 404586
},
"event_id": "$ew4mbWQaAJ95LzAdHK3ysmCnY0p9tWs4t4UVylp5AdI"
},
{
"type": "m.room.message",
"sender": "@admin:twkl.chat",
"content": {
"msgtype": "m.text",
"body": "bye"
},
"origin_server_ts": 1724338572426,
"unsigned": {
"age": 324601
},
"event_id": "$LS9l8z30tyJUg6C_pnuOv3Q6UgTm-PSlDYCUi5x-gjM"
},
{
"type": "m.room.message",
"sender": "@admin:twkl.chat",
"content": {
"msgtype": "m.text",
"body": "bye"
},
"origin_server_ts": 1724338809491,
"unsigned": {
"age": 87536
},
"event_id": "$SfARhd-gLqCiMm5XGD3xvfqW37b5gQ4HPC8lahPvIKw"
},
{
"type": "m.room.message",
"sender": "@admin:twkl.chat",
"content": {
"msgtype": "m.text",
"body": "hello world!"
},
"origin_server_ts": 1724338858062,
"unsigned": {
"age": 38965
},
"event_id": "$OtoflM-SnQui8tEZUBToIl_UtGtjjmvjfVGDbeloql8"
}
],
"prev_batch": "s100_597_0_67_104_73_1_75_0_1",
"limited": false
},
"state": {
"events": []
},
"account_data": {
"events": []
},
"ephemeral": {
"events": [
{
"type": "m.receipt",
"content": {
"$ew4mbWQaAJ95LzAdHK3ysmCnY0p9tWs4t4UVylp5AdI": {
"m.read": {
"@rahaf:twkl.chat": {
"ts": 1724338546692,
"thread_id": "main"
}
}
}
}
}
]
},
"unread_notifications": {
"notification_count": 3,
"highlight_count": 0
},
"summary": {}
}
}
}
}
Search Messages