Views: 828 (Data available since 06.02.2017)

The method pin dialog in favorites

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

Parameters

Parameter Example Req. Description Revision
DIALOG_ID chat17 Yes Dialog ID 19
PIN Y No Pin or unpin a dialog 19
  • DIALOG_ID – dialog ID (number if user, chatXXX if chat).
  • If the PIN = N parameter is specified, the pinned dialog will be unpinned.

Method call

JavaScript

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

PHP

$result = restCommand('im.recent.pin', Array(
	'DIALOG_ID' => 'chat17',
	'PIN' => 'Y'
), $_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.

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.