Views: 5063
Last Modified: 23.03.2022

Deletes dialog from list of recent chats

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.

Examples

Parameter Example Req. Description Revision
DIALOG_ID chat17 Yes Dialog ID. Format:
chatXXX – recipient chat, when message is sent to chat
or XXX – recipient ID, when message is for private conversation
18

Called method and response

JavaScript

BX24.callMethod('im.recent.hide', {
	'DIALOG_ID': 'chat17'
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('im.recent.hide', Array(
	'DIALOG_ID' => 'chat17'
), $_REQUEST["auth"]);	

Example of response

{
	"result": true
}  

Example of response when error occurs

{
    "error": "DIALOG_ID_EMPTY",
    "error_description": "Dialog ID can't be empty"
}

Description of keys:

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

Possible error codes

Code Description
DIALOG_ID_EMPTY Dialog ID not passed.



Courses developed by Bitrix24