making a core reporting api data request (php)

Once you have a query defined, you call it\'s execute method to send the query to Google Analytics servers. If the query was successful, the API will return the requested data. If any errors occur, the API will return a specific status code and a message describing the error. All applications should properly catch and handle errors.

try {
    $results = queryCoreReportingApi();
     Success. Do something cool!

} catch (apiServiceException $e) {
     Handle API service exceptions.
    $error = $e->getMessage();