Accessing Google My Business API without login (using service account) : <p>I want to access the locations associated with my account and their reviews, for that I am using the google my business API and I have access to it (it does work on oAuthplayground).</p>

<p>Now I want to access the google my business api without logging into my account, for that I am trying to make it work with the service account. But no luck so far, please advice how to proceed with this. I have enabled the G suite in the service account and I have also tried to give access to the service account email (ID) for the my business manage but it stays in <em>Invited</em> state, as there is no way to actually accept the invite.</p>

<p>When I try to send request using my account as subject.</p>

<pre><code>$client = new Google_Client();
$client-&gt;addScope('https://www.googleapis.com/auth/plus.business.manage');
$client-&gt;setAuthConfig(dirname(__FILE__) . '/Xyz Review API-service account.json');
$client-&gt;setSubject('xyz*****abc@gmail.com');
$business_service_class = new Google_Service_Mybusiness($client);
$result_accounts = $business_service_class-&gt;accounts-&gt;listAccounts();
echo json_encode($result_accounts);
exit;
</code></pre>

<blockquote>
  <p>Response:
  {"nextPageToken":null}</p>
</blockquote>

<p>If I use the google service account ID as email id in subject then I get following response.</p>

<pre><code>$client-&gt;setSubject('xyz-review-service@xyz-review-api.iam.gserviceaccount.com');
</code></pre>

<blockquote>
  <p>Response:
  Error 500
  { "error": "unauthorized_client", "error_description": "Unauthorized client or scope in request." }</p>
</blockquote>

<p>If I am doing this completely wrong then please do advice how to proceed with this. Thank you.</p>
