AccountVkads::getProfile

  1. Bitrix24 API (v. 23.675.0)
  2. seo
  3. AccountVkads
  4. getProfile
  • Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/retargeting/services/accountvkads.php
  • Класс: Bitrix\Seo\Retargeting\Services\AccountVkads
  • Вызов: AccountVkads::getProfile
public function getProfile()
{
	$response = $this->getRequest()->send(array(
		'methodName' => 'analytics.profile',
		'parameters' => []
	));

	if (
		$response->isSuccess()
		&& ($data = $response->fetch())
	)
	{
		$result = [
			'ID' => $data['ID'],
			'NAME' => $data['FIRST_NAME'] . ' ' . $data['LAST_NAME'],
			'LINK' => 'https://ads.vk.com/hq/budget/transactions/',
		];

		$result['PICTURE'] = (Context::getCurrent()->getRequest()->isHttps() ? 'https' : 'http')
			. '://'
			.  Context::getCurrent()->getServer()->getHttpHost() . '/bitrix/images/seo/integration/vklogo.svg';

		return $result;
	}

	return null;
}

Добавить комментарий