Views: 1047 (Data available since 06.02.2017)

The method disables notifications in chat

Revision: 19
Get information on the current API revision (platform version) – im.revision.get.

Parameters

Parameter Example Req. Description Revision
CHAT_ID 17 Yes Chat ID 19
MUTE Y No Disable or enable notifications - Y|N 19
  • Variants of MUTE key: Y or N.

Method call

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"]);

Examples of result

{
	"result": true
}

Example of result when error occurs

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

Description of keys:

  • error – error code
  • error_description – brief description of error

Possible error codes

Code Description
CHAT_ID_EMPTY Chat ID not passed

Attention! The method is specified with using of the restCommand function. This method is used to send data in Bitrix24 and is available in the EchoBot example as well as in this article. You can use your own function or BX24.callMethod, or bitrix24-php-sdk JavaScript methods.





Courses developed by «Bitrix», Inc.