Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
requestvkontakte.php
1<?
2
4
6
8{
9 const TYPE_CODE = 'vkontakte';
10 const REST_METHOD_PREFIX = 'seo.client.ads.vkontakte';
11
12 protected function directQuery(array $params = array())
13 {
14 $url = 'https://api.vk.com/method/';
15 $url .= $params['endpoint'];
16
17 $clientParameters = is_array($params['fields']) ? $params['fields'] : array();
18 $clientParameters = $clientParameters + ['v' => '5.107', 'access_token' => $this->adapter->getToken()];
19
20
21 if (isset($params['method']) && $params['method'] == 'POST')
22 {
23 return $this->client->post($url, $clientParameters);
24 }
25 else
26 {
27 $url .= '?' . http_build_query($clientParameters, "", "&");
28 return $this->client->get($url);
29 }
30 }
31}