Hello I need to get access to a spreadsheet from google spreadsheet API. I have enabled Google Sheets API and added API key, but this doesn't work!!! https://sheets.googleapis.com/v4/spreadsheets/[my_spreadsheet_id]/values/A1?key=[my_api_key]
The result is: 403 - The caller does not have permission
But if I provide public access for this spreadsheet ---> it works!!!
The result is: 200 - [correct requested data .....]
The my question is: How to get access to a private spreadsheet from the API?
I need to read and write orders data there from my website using php's functions like file_get_contents()
Basically, you need to get authorization as mentioned in the documentation.
Further information from OAuth 2.0 documentation, when accessing a Google API using OAuth 2.0, all applications follow these steps:
Lastly, to help you with the implementation using PHP, you may also add Authentication and authorization to your list of references. Hope that helps!