• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/yandex.php
  • Класс: CYandexOAuthInterface
  • Вызов: CYandexOAuthInterface::GetAppInfo
public function GetAppInfo()
{
	if ($this->access_token === false)
		return false;

	$h = new BitrixMainWebHttpClient();
	$h->setTimeout($this->httpTimeout);

	$result = $h->get(self::USERINFO_URL.'?format=json&oauth_token='.urlencode($this->access_token));

	try
	{
		$result = BitrixMainWebJson::decode($result);
		$result = array_key_exists("client_id", $result)
						? array("id" => $result["client_id"])
						: array();
	} catch (BitrixMainArgumentException $e)
	{
		$result = array();
	}

	return $result;
}