Views: 7208
Last Modified: 23.03.2022

The method cancels notification for read messages.

Attention: restCommand function is used here for illustration purposes only. It is taken from the EchoBot example. You can send a REST command with your own function, or use the BX24.callMethod or bitrix24-php-sdk methods.

Parameters

Revision Get current information about current API revision (platform version) – im.revision.get : 18
Parameter Example Req. Description Revision
ID 17 Yes Notification ID 18
ONLY_CURRENT N No Read only the specified notification 18
  • If the ONLY_CURRENT parameter is passed with Y, a read notification check is set only for the specified ID. Otherwise, the check is set for notification with equal or higher ID.

Method call

JavaScript

BX24.callMethod('im.notify.read', {
	'ID': 17,
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('im.notify.read', Array(
	'DIALOG_ID' => '17'
), $_REQUEST["auth"]);	

Example of response

{
	"result": true
}        



Courses developed by Bitrix24