src/Yandex/Metrica/MetricaClient.php
protected function sendGetRequest($resource, $params = [])
    {
        $response = $this->sendRequest(
            'GET',
            $this->getServiceUrl($resource, $params),
            [
                'headers' => [
                    'Accept' => 'application/x-yametrika+json',
                    'Content-Type' => 'application/x-yametrika+json',
                    'Authorization' => 'OAuth ' . $this->getAccessToken(),
                ]
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        if (isset($decodedResponseBody['links']) && isset($decodedResponseBody['links']['next'])) {
            $url = $decodedResponseBody['links']['next'];
            unset($decodedResponseBody['rows']);
            unset($decodedResponseBody['links']);
            return $this->getNextPartOfList($url, $decodedResponseBody);
        }
        return $decodedResponseBody;
    }
protected function sendGetRequest($resource, $params = [])
    {
        $response = $this->sendRequest(
            'GET',
            $this->getServiceUrl($resource, $params),
            [
                'headers' => [
                    'Accept' => 'application/x-yametrika+json',
                    'Content-Type' => 'application/x-yametrika+json',
                    'Authorization' => 'OAuth ' . $this->getAccessToken(),
                ]
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        if (isset($decodedResponseBody['links']) && isset($decodedResponseBody['links']['next'])) {
            $url = $decodedResponseBody['links']['next'];
            unset($decodedResponseBody['rows']);
            unset($decodedResponseBody['links']);
            return $this->getNextPartOfList($url, $decodedResponseBody);
        }
        return $decodedResponseBody;
    }
protected function sendGetRequest ( $ resource , $ params = [ ] ) { $ response = $ this -> sendRequest ( 'GET' , $ this -> getServiceUrl ( $ resource , $ params ) , [ 'headers' => [ 'Accept' => 'application/x-yametrika+json' , 'Content-Type' => 'application/x-yametrika+json' , 'Authorization' => 'OAuth ' . $ this -> getAccessToken ( ) , ] ] ) ; $ decodedResponseBody = $ this -> getDecodedBody ( $ response -> getBody ( ) ) ; if ( isset ( $ decodedResponseBody [ 'links' ] ) && isset ( $ decodedResponseBody [ 'links' ] [ 'next' ] ) ) { $ url = $ decodedResponseBody [ 'links' ] [ 'next' ] ; unset ( $ decodedResponseBody [ 'rows' ] ) ; unset ( $ decodedResponseBody [ 'links' ] ) ; return $ this -> getNextPartOfList ( $ url , $ decodedResponseBody ) ; } return $ decodedResponseBody ; }
Send GET request to API resource

@param string $resource
@param array $params
@return array
Send GET request to API resource