• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/lib/apclient.php
  • Класс: BitrixSocialservicesApClient
  • Вызов: ApClient::call
public function call($methodName, $additionalParams = null)
{
	if($this->checkConnection($this->connection))
	{
		$request = $this->prepareRequest($additionalParams);

		$httpClient = $this->getHttpClient();

		$response = $httpClient->post(
			$this->getRequestUrl($methodName),
			$request
		);

		$result = $this->prepareResponse($response);

		if(!$result)
		{
			$this->errorCollection->add(
				array(
					new Error("Wrong answer from service", static::ERROR_WRONG_ANSWER)
				)
			);
		}

		return $result;
	}
	else
	{
		throw new SystemException("No connection credentials");
	}
}