14 $this->endpoint = $params[
'endpoint'];
16 $url =
'https://api-audience.yandex.ru/v1/management/';
17 $url .= $params[
'endpoint'];
19 $clientParameters = is_array($params[
'fields']) ? $params[
'fields'] : array();
20 $this->client->setHeader(
'Authorization',
'OAuth ' . $this->adapter->getToken());
22 if ($params[
'method'] ==
'GET')
24 $url .=
'?' . http_build_query($clientParameters,
"",
"&");
25 return $this->client->get($url);
27 elseif ($params[
'method'] ==
'DELETE')
29 return $this->client->delete($url, $clientParameters,
true);
33 return $this->client->post($url, $clientParameters,
true);