Views: 3006
Last Modified: 14.06.2022

Gets information on dialog (chat) of Open Channel operator

Revision: 2
Get information on current API revision (Open channel platform version) – imopenlines.revision.get.

Parameters
Parameter Example Required Description Revision
CHAT_ID 13 No Chat numerical ID 2
DIALOG_ID chat29 No Dialog identifier. Format:
chatXXX – recipient chat in case of chat message
or XXX – recipient ID, if message for private dialog/chat
2
SESSION_ID 1743 No Session ID in Open Channel 2
USER_CODE livechat|1|1373|211 No Open Channel User string ID sourced from CRM, for example livechat|1|1373|211 or imol|livechat|1|1373|211 2


Can be used to call any of parameters.

Method call and response

JavaScript

BX24.callMethod('imopenlines.dialog.get', {USER_CODE: 'livechat|1|1373|211'}, function(result){
    if(result.error())
    {
        console.error(result.error().ex);
    }
    else
    {
        console.log(result.data());
    }
});

PHP

$result = restCommand('imopenlines.dialog.get', Array(
	'DIALOG_ID': 'chat29'
), $_REQUEST["auth"]);

Response example

{
    "result": 
  {
	avatar: ""
	color: "#4ba984"
	date_create: "2020-05-12T17:40:55+02:00"
	dialog_id: null
	entity_data_1: "N|NONE|0|N|N|0|1591872180|1|0|"
	entity_data_2: ""
	entity_data_3: ""
	entity_id: "livechat|1|1363|203"
	entity_type: "LINES"
	extranet: false
	id: 1364
	manager_list: []
	message_type: "L"
	name: "John Smith - Priority support"
	owner: 0
	type: "lines"
  }
}

Key description:

  • avatar – link to avatar (when empty, avatar is not specified)
  • color – chat color in hex format
  • date_create – chat created date in АТОМ format
  • dialog_id – dialog ID
  • entity_data_1 – ex chat external data t
  • entity_data_2 – chat external data
  • entity_data_3 – chat external data
  • entity_id – chat external code – identifier
  • entity_type – chat external code – type
  • extranet – extranet user chat participation attribute (true/false)
  • id – chat ID
  • manager_list – list of operators
  • message_type – chat message type
  • name – Open Channel name
  • owner – chat creator ID
  • type – chat type (group[ chat, call chat, Open Channel chat and etc.)


Response example in case of error

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

Key description:

  • error – error code
  • error_description – error brief description

Possible error ID codes

ID Description
DIALOG_ID_EMPTY Dialog ID not passed
ACCESS_ERROR Current user doesn't have access permissions for dialog




Courses developed by Bitrix24