Search This Blog

Friday, January 7, 2022

Google sheets api - [The caller does not have permission] - shared sheets

In case you cant access to shared sheets via your code.

make sure to create a service account , copy the "email" for this service account.

make sure the one who shared the file, share it with your service account email.

and it should work.


working with API_KEY on shared sheets get failure.

only service account.


access to your own sheets could be done via api_key or service account.

links:

https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc

https://cloud.google.com/docs/authentication/production

https://developers.google.com/sheets/api/quickstart/dotnet

        https://ios.developreference.com/article/10721497/Using+.Net+to+access+Google+Sheets+with+a+service+account+generates+a+%E2%80%9CThe+caller+does+not+have+permission+%5B403%5D%E2%80%9D+error

  

Enjoy 

Yaniv