title: Google Analytics API: How to get all Report ID
body: <p>I want to select all the Report ID of all the added URLs in the Google Analytics account.
  How can I do something like this? </p>
  
  <pre><code>SELECT report_id FROM google_analytics_account
  </code></pre>
  
  <p>Example URLs in the Google Analytics account:</p>
  
  <pre><code>https://www.google.com/analytics/web/?hl=en#home/a3456789w2345678p1234567/
  https://www.google.com/analytics/web/?hl=en#home/a3456789w2345678p9876543/
  </code></pre>
  
  <p>Where the Report IDs there are 1234567 and 9876543.</p>
  
  <p>Can I do that using the GAPI class only? How?</p>
  
  <p>I have a gapi class.</p>
  
  <pre><code>&lt;!-- language: lang-php --&gt;
  
      require_once 'gapi.class.php';
      $ga = new gapi('my_test_email@gmail.com', 'my_test_email_password');
  
      $report_id = 1234567;
      $dimensions = array('browser', 'browserVersion');
      $metrics = array('pageviews', 'visits');
      $sort_metric = null;
      $filter = null;
      $start_date = null;
      $end_date = null;
      $start_index = 1;
      $max_results = 30;
      $ga-&gt;requestReportData(
          $report_id, 
          $dimensions, 
          $metrics, 
          $sort_metric, 
          $filter, 
          $start_date, 
          $end_date, 
          $start_index, 
          $max_results
      );
  
      foreach ($ga-&gt;getResults() as $result) {
          echo '&lt;strong&gt;'.$result.'&lt;/strong&gt;&lt;br /&gt;';
          echo 'Pageviews: ' . $result-&gt;getPageviews() . ' ';
          echo 'Visits: ' . $result-&gt;getVisits() . '&lt;br /&gt;';
      }
      echo '&lt;p&gt;Total pageviews: ' . $ga-&gt;getPageviews() . ' total visits: ' . $ga-&gt;getVisits() . '&lt;/p&gt;';
      echo '&lt;font color="blue"&gt;&lt;pre&gt;',print_r($ga-&gt;getResults()),'&lt;/pre&gt;&lt;/font&gt;';
      echo '&lt;hr /&gt;';
  </code></pre>
  
  <p>Thanks! :)</p>