I'm trying to connect to the Google Calendar API
const API_KEY = "AIzaSyACg6feWvXYw_czwB7yYZxr2HFZw8Wjd9k"
axios({
method:'get',
url:'https://www.googleapis.com/calendar/v3/calendars/primary/events?key=${API_KEY}',
headers: {
"Content-Type": "application/json",
"Authorization": 'Bearer ${response.credential.accessToken}'
}
})
.then(function(response) {
response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
});
but I get this error
error
:
{errors: [{domain: "global", reason: "insufficientPermissions", message: "Insufficient Permission"}],…}
code
:
403
errors
:
[{domain: "global", reason: "insufficientPermissions", message: "Insufficient Permission"}]
message
:
"Insufficient Permission"