• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/oauth/client.php
  • Класс: BitrixSaleExchangeIntegrationOAuthClient
  • Вызов: Client::getAccessToken
public function getAccessToken($grant, array $options = [])
{
	$params = [
		"grant_type" => $grant,
		"client_id" => $this->getClientId(),
		"client_secret" => $this->getClientSecret(),
	];

	$params = array_merge($params, $options);
	$success = $this->httpClient->query($this->getAccessTokenMethod(), $this->getAccessTokenUrl($params));

	$response = [];
	if ($success)
	{
		try
		{
			$response = Json::decode($this->httpClient->getResult());
		}
		catch (BitrixMainArgumentException $exception)
		{

		}
	}

	return $response;
}