1

Is it possible to test Google Calendar API v3 client side read-only data in javascript implementation on the localhost? I simply want to parse json retrieved with jquery such as $.getJSON(restfulUrl, successFunction(data));

This is the post I read to succeed in connecting with v3 and getting the json on my web server: Parse Google Calendar v3 API JSON with JQuery

However, it is incredibly obnoxious to have to upload a new version of my development script every time I want to test it. I am able to get this far because I listed my web server domain under public api access referrers in the Google Developers Console. I listed my organization IP in the same referrer list, but that does not work. I also tried adding localhost and googleapis.com but those don't work either.

Community
  • 1
  • 1
ThisClark
  • 14,352
  • 10
  • 69
  • 100
  • 1
    What issue do you have when you try it locally? Are you viewing your file via file://// protocol or do you have a local server setup and viewing it over http://localhost? If I remember cross-domain access doesn't work when page is loaded via file:// protocol – Matt Nov 17 '14 at 21:14
  • I was getting 403 forbidden. I hate to say it after going to the trouble of posting the question, but it looks like the solution is actually to just put localhost and/or localhost/* in the approved referrers. I am now seeing the data on localhost webserver, not file:// – ThisClark Nov 17 '14 at 21:17

1 Answers1

1

If you found this Q&A by search engine, you may also find it helpful to visit the more thoroughly discussed topic at Google Calendar API v3 Access Not Configured

I had to manage my project, first by visiting https://console.developers.google.com/project.

I clicked the Edit allowed referrers button and added these to the list:

localhost
localhost/*
*.localhost/*
*.localhost
127.0.0.1/*

At the time of writing, this was all done under APIs & auth > Credentials. This is necessary even for publicly available calendars.

enter image description here

Community
  • 1
  • 1
ThisClark
  • 14,352
  • 10
  • 69
  • 100
  • 1
    According to the current UI of the google developers tool "Edit allowed referrers" is not available in the same position. Can you please help me where I can find this on the new UI? – Akash Sethi Nov 17 '21 at 18:48
  • 1
    If it is an API key listed on that page, it is found in Application Restrictions > HTTP referrers. If it is an OAuth key on that page, it is found under Authorized JavaScript origins. In both cases, list the domains you need. – ThisClark Nov 17 '21 at 20:43