title: php | Google Webmaster API Service Account has no permission
body: <p>I am using the following code to get the stats for my website from the search console:</p>
  
  <pre><code>$client = new Google_Client();
  $creds = $client-&gt;loadServiceAccountJson('---JSON FILE---', 'https://www.googleapis.com/auth/webmasters.readonly');
  $client-&gt;setAssertionCredentials($creds);
  
  
  $service = new Google_Service_Webmasters($client);
  
  $ressource = $service-&gt;searchanalytics;
  
  $options = new Google_Service_Webmasters_SearchAnalyticsQueryRequest();
  $options-&gt;setStartDate('2015-11-11');
  $options-&gt;setEndDate('2015-11-11');
  
  try{
      $response = $ressource-&gt;query('http://www.example.com/', $options);
  } catch (Exception $e){
      echo $e-&gt;getMessage();
  }
  </code></pre>
  
  <p>I use a google service account to authorize the api call but it gives me the error:</p>
  
  <blockquote>
    <p>Error calling POST <a href="https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.example.com%2F/searchAnalytics/query" rel="nofollow">https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.example.com%2F/searchAnalytics/query</a>: (403) User does not have sufficient permission for site 'http*://www.example.com/'. See also: <a href="https://support.google.com/webmasters/answer/2451999" rel="nofollow">https://support.google.com/webmasters/answer/2451999</a>.</p>
  </blockquote>
  
  <p>I also added the email-address of the service account to my search console property as an owner, but the error is still there. I dont know anymore, what i am doing wrong?</p>