• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/marketing/configurator.php
  • Класс: BitrixSeoMarketingConfigurator
  • Вызов: Configurator::getInstagramAccounts
static function getInstagramAccounts($type)
{
	if (!static::canUse())
	{
		return array();
	}

	$result = array();

	$account = static::getService()->getAccount($type);
	$accountsResult = $account->getInstagramList();
	if ($accountsResult->isSuccess())
	{
		while ($accountData = $accountsResult->fetch())
		{
			if ($accountData['ID'])
			{
				$result[] = array(
					'id' => $accountData['ID'],
					'name' => $accountData['NAME'] ? $accountData['NAME'] : $accountData['ID'],
					'page_id' => $accountData['PAGE_ID'] ? $accountData['PAGE_ID'] : $accountData['ID'],
					'actor_id' => $accountData['IG_ID']
				);
			}
		}
	}
	else
	{
		self::$errors = $accountsResult->getErrorMessages();
	}

	return $result;
}