Views: 1678
Last Modified: 23.03.2022

Disables notifications in chat

Revision Get current information about current API revision (platform version) – im.revision.get : 18

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

Parameter Example Required Description Revision
CHAT_ID 17 Yes Chat ID 19
MUTE Y Yes Disable or enable notifications - Y|N 19
  • Variants for MUTE key: Y или N.

Called method and response

JavaScript

BX24.callMethod('im.chat.mute', {
	'CHAT_ID': 17,
	'MUTE': 'Y'
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('im.chat.mute', Array(
	'CHAT_ID' => 17,
	'MUTE' => 'Y'
), $_REQUEST["auth"]);

Response example

{
	"result": true
}

Example of response on error

{
    "error": "CHAT_ID_EMPTY",
    "error_description": "Chat ID can't be empty"
}

Key description:

  • error – error code
  • error_description – error brief description

Possible error codes

Code Description
CHAT_ID_EMPTY Chat ID not passed



Courses developed by Bitrix24