AccountFacebook::getProfile

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

	if ($response->isSuccess() && $data = $response->fetch())
	{

		return [
			'ID' => $data['ID'],
			'NAME' => $data['NAME'],
			'LINK' => $data['LINK'],
			'PICTURE' => $data['PICTURE'] ? $data['PICTURE']['data']['url'] : null,
		];
	}

	return null;
}

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