Google PHP Client API: Insufficient Permission

438

Solution:

The apps#list method requires authorization with the scopehttps://www.googleapis.com/auth/drive.apps.readonly. Just add it to the array of scopes:

$client->setAssertionCredentials(new Google_Auth_AssertionCredentials(
  SERVICE_ACCOUNT_NAME,
  array('https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.apps.readonly'),
  $key)
);
657

Answer

Solution:

You must even disable Google drive api for your project in Developer Console under Apis & auth

People are also looking for solutions to the problem: apache - PHP Warning: Cannot modify header information - headers already sent by

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.