• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::botList
static function botList($arParams, $n, CRestServer $server)
{
	if ($server->getAuthType() == BitrixRestSessionAuthAuth::AUTH_TYPE)
	{
		throw new BitrixRestRestException("Access for this method not allowed by session authorization.", "WRONG_AUTH_TYPE", CRestServer::STATUS_FORBIDDEN);
	}
	$result = Array();
	$list = BitrixImBot::getListCache();
	foreach ($list as $botId => $botData)
	{
		if ($botData['TYPE'] == BitrixImBot::TYPE_NETWORK)
			continue;

		$result[$botId] = Array(
			'ID' => $botId,
			'NAME' => BitrixImUser::getInstance($botId)->getFullName(),
			'CODE' => $botData['CODE'],
			'OPENLINE' => $botData['OPENLINE'],
		);
	}

	return $result;
}