Documentation

imopenlines.session.mode.pin

Scope: catalog Permissions to execute: for all

Method pins or unpins a conversation for current agent.

Parameters

ParameterExampleRequiredDefaultDescription
CHAT_ID2020YesChat ID.
ACTIVATEYNoNActive flag.

Method call and response

JavaScript for Bitrix24 On-premise.

BX.rest.callMethod(
	'imopenlines.session.mode.pin',
	{
		CHAT_ID: 2047,
		ACTIVATE: 'Y'
	}
)
	.then(result => console.log(result.data()))
	.catch(result => console.warn(result.error().ex))
;

JavaScript for Bitrix24 Cloud:

BX24.callMethod(
    'imopenlines.session.mode.pin',
    {
            CHAT_ID: 2024
        },
    function(result)
    {
            if(result.error())
        {
                 console.warn(result.error().ex);
            return false;
         }

            console.log(result.data());
    }
);

Response example:

true

Possible error codes

CodeDescription
ACCESS_DENIEDCurrent user doesn't have access to the specified chat.
CHAT_TYPESpecified chat is not an Open Channel.
CHAT_IDChat ID is incorrect.
ERROR_USER_NOT_OPERATORAttempt to pin/unpin chat by non-agent user.


© «Bitrix24», 2001-2024