Esempio n. 1
0
 public function export($url)
 {
     list($baseUrl, $query) = explode('?', $url);
     /** @var Response $response */
     $response = $this->api->request($baseUrl, 'GET', ['Accept' => 'text/csv; charset=UTF-8', 'GData-Version' => '3.0'], \GuzzleHttp\Psr7\parse_query($query));
     return $response->getBody();
 }
 /**
  * @param $accountId
  * @param $webpropertyId
  * @param int $startIndex
  * @param int $maxResults
  * @return array
  */
 public function getProfiles($accountId, $webpropertyId, $startIndex = 1, $maxResults = 5000)
 {
     $params = array('start-index' => $startIndex, 'max-results' => $maxResults, 'quotaUser' => $accountId);
     $url = self::ACCOUNTS_URL . '/' . $accountId . '/webproperties/' . $webpropertyId . '/profiles';
     $response = $this->api->request($url, 'GET', $params);
     $result = json_decode($response->getBody(), true);
     if (isset($result['items'])) {
         return $result['items'];
     }
     return array();
 }
 public function getCellsFeed(File $file)
 {
     return json_decode($this->api->request(sprintf(self::SPREADSHEET_CELL, $file->getGoogleId(), $file->getSheetId()) . '?alt=json', 'GET', ['Accept' => 'application/json', 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0'])->getBody(), true);
 }