From today my website has a connectivity problem with my GCal. (It’s worked perfectly since from one month).
I call to GCal via jQuery GET:
https://www.googleapis.com/calendar/v3/calendars/{MY_CALENDAR}/events?key={MY_API_KEY}
And the response is (JSON):
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyExpired",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
I not understand why key expired. Can you help me, please? I’ve not read about fixed time life on api key. I haven’t exceeded the daily quota.
Sorry for my English level.
Thanks.
The Google Calendar API is a RESTful API that can be accessed through explicit HTTP calls or via the Google Client Libraries. The API exposes most of the features available in the Google Calendar Web interface.
calendarId is the email address of your calendar. If you're just using your own, then use the string "primary". eventId is the ID of the event that you want to modify.
The keyExpired event is triggered by the OAuth 1.0 process:
If the user approves your application's access request, Google issues an authorized request token. Each request token is valid for only one hour. Only an authorized request token can be exchanged for an access token, and this exchange can be done only once per authorized request token.
OAuth 2.0 has different expiration triggers that are not time-based.
You should write your code to anticipate the possibility that a granted token might no longer work. A token might stop working for one of these reasons:
The user has revoked access.
The token has not been used for six months.
The user changed passwords and the token contains Gmail, Calendar, Contacts, or Hangouts scopes.
The user account has exceeded a certain number of token requests.
References
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With