0

I'm using the nodejs googleapis module to authenticate the google calendar API. I've managed to get an access token. My code is below:

var tok = { 
  access_token: 'ya29.XXXXX-XXXXXXX',
  refresh_token: '1/XXXXXXXXXXX',
  scope: 'https://www.googleapis.com/auth/calendar',
  token_type: 'Bearer',
  expiry_date: 1569089181800 
}
const calendar = google.calendar({version: 'v3', tok});
calendar.events.list({
  calendarId: 'primary',
  timeMin: (new Date()).toISOString(),
  maxResults: 10000,
  singleEvents: true,
  orderBy: 'startTime',
}, (err, res) => {

});

Each time I run this command I get the following error: The API returned an error: Error: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.

Can't figure out why this is the case (seeing as it was working before and I've only used a handful of requests). I've enabled billing and enabled/disabled/re-enabled the calendar API in the Google Cloud console.

fbraga
  • 711
  • 4
  • 9
Viper
  • 1,327
  • 2
  • 12
  • 33

1 Answers1

0

It appears that the token is expired since the epoch value corresponds to

Sep 21 2019 17:30:00 UTC/GMT

I think you need a fresh token

Soumen Mukherjee
  • 2,953
  • 3
  • 22
  • 34