I created a key in the google cloud console. I even tried remaking it and using a the new one.
Im trying to use it like so:
export const getSheet= async () => {
try {
const sheetId ='xxxxxxx'
const tabName = 'myTab'
const accountKey = 'xxxxxxx'
const url =' https://sheets.googleapis.com/v4/spreadsheets/'+ sheetId +'/values/'+tabName+'?key='+ accountKey
console.log(url)
const response = await fetch(url);
console.log(response);
return '';
} catch (error) {
console.log(error);
} finally {
console.log('finally');
}
};
The request being sent is:
https://sheets.googleapis.com/v4/spreadsheets/xxxxxxx/values/myTab?key=xxxxxxx
No matter what I do I get
error: {code: 403, message: "The caller does not have permission", status: "PERMISSION_DENIED"}
Ive refered to these stack overflow posts regarding the same issue with no luck
- Error 403 on Google Sheets API
- Google Sheets API V4 403 Error
- Getting 403 from Google Sheets API using apikey
Has anyone come across this and was able to fix it?
Thanks -Coffee