Google Calendar Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup


Google Calendar Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup



So I am trying to work with some code that takes a ical file and syncs it to my google calendar. The code I am using as a base can be found here.



However, I seem to be get errors in the code that would make me believe that I am having trouble authenticating my credentials.



Below is the code I use for authenticating:


def get_credentials():
store = Storage(CREDENTIAL_PATH)
credentials = store.get()
if not credentials or credentials.invalid:
flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
flow.user_agent = APPLICATION_NAME
credentials = tools.run_flow(flow, store, None)
return credentials


credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('calendar', 'v3', http=http)

service.events().update(calendarId=CALENDAR_ID, eventId=gcal_event['id'],body=gcal_event).execute()



The error I get is:


{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}



Is there a reason my credentials are not authenticating? I used a very similar code structure with the google sheets api and it worked great.



I should also note that in the previous parts of the script the events in my calendar are actually grabbed from the google calendar api.



Update:



Looks like it had nothing to do with authentication. Instead the calendar event id was not in the correct format. Anyone know a way to convert a string of text into a format of base32hex encoding?




2 Answers
2



You can base32-encode the event id using the base64 package.


>>> import base64
>>> id = 'My-Event-Id'
# id must be bytes if you are using python3, so call encode on it.
>>> encoded = base64.b32encode(id.encode())
>>> encoded
b'JV4S2RLWMVXHILKJMQ======'



Event ids can be decoded like this:


>>> decoded = base64.b32decode(encoded).decode()
>>> decoded
'My-Event-Id'



You need to sign up for paid access or limit the number of requests you make in a single day. From the Google API documentation for the Calendar API



The Google Calendar API has a courtesy limit of 1,000,000 queries per day.



Borrowed from : https://developers.google.com/calendar/pricing



For more info about the specific errors and other possible solutions see the rest of Google’s documentation https://developers.google.com/calendar/v3/errors#403_daily_limit_exceeded





I am not making 1,000,000 queries per day. This occurred on the first execution of the script. Additionally, the google api dashboard is only showing roughly 600 queries in total over the life of the project. There is no way I am hitting the usage limits. Additionally wouldnt it just say usage limit exceeded? Why include the Unauthenticated part?
– Marc Henning
Jul 2 at 0:41






Then maybe try adding some logging and see if the credentials are being picked up from CREDENTIAL_PATH or if it is creating a new set of credentials or if it is creating a credentials object at all.
– Brandon Haugen
Jul 2 at 0:55






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Rothschild family

Cinema of Italy