user147215
user147215

Reputation:

Google Sheets API - PERMISSION_DENIED

I am trying to access some data from a Google Sheet using the V4 Spreadsheets API and am getting a 403 with PERMISSION_DENIED. I have verified that the API has been enabled and am passing key={MY_KEY} in the URL. I set the sharing settings to "Anyone with a link" in my personal Google account which is working fine and I am getting data back using the following URL:

https://sheets.googleapis.com/v4/spreadsheets/MY_KEY/values/Sheet1?key=MY_KEY

However, at work we use GSuite and Link Sharing is restricted to our organization only so when I hit that URL for a Sheet in my work account with the same setup from my personal account (excluding the sharing settings), I get the 403 with PERMISSION_DENIED.

I don't see any documentation as to how to authorize outside of an organization or if its possible to add an exemption to be able to share outside of the organization.

Upvotes: 1

Views: 2016

Answers (1)

Sam Berlin
Sam Berlin

Reputation: 3773

It is not possible to have an exemption from the sharing settings. If the policy prohibits sharing outside the organization, then the credentials accessing the sheet must be from a user in the organization.

Upvotes: 2

Related Questions