Hello Matt, Unfortunately, I am not a Gadget specialist. One advice I could give though is to use SSL (https) instead of non-SSL (http).
Also, try catching the 403 error, you should always get an error message in the body of the response giving more details as to what caused the error and try refreshing the token. Best, Alain On Wed, Sep 14, 2011 at 8:55 PM, MattG <[email protected]> wrote: > Alain, > > So I am creating a sidebar calendar gadget using javascript. My gadget > followed the model at > http://code.google.com/apis/gdata/articles/gdata_gadgets.html > In my xml file I have the following Ouath tag: > > <OAuth> > <Service name="google"> > <Request url="https://www.google.com/accounts/ > OAuthGetRequestToken?scope=http://www.google.com/calendar/feeds/ > default/private/full" method="GET"/> > <Authorization url="https://www.google.com/accounts/ > OAuthAuthorizeToken?oauth_callback=http://oauth.gmodules.com/gadgets/ > oauthcallback" /> > <Access url="https://www.google.com/accounts/ > OAuthGetAccessToken" /> > </Service> > </OAuth> > > In my init method I have a call to calendarService.useOAuth('google'); > and a fetchdata method that checks response.oauthApprovalUrl and if > not authenticated displays a popup for user to grant access via > shindig just as the above blogger example: > > var requestCallback = function(response) { > if (response.oauthApprovalUrl) { > var popup = shindig.oauth.popup({ > destination: > response.oauthApprovalUrl, > windowOptions: > 'height=600,width=800', > onOpen: function() { > showOneSection('waiting'); > }, > onClose: function() { //When it > closes, fetch the data again. > showOneSection('loading'); > fetchData(); > } > }); > //set up the links to start OAuth process > $('personalize').onclick = > popup.createOpenerOnClick(); > $('approvaldone').onclick = > popup.createApprovedOnClick(); > showOneSection('approval'); > } > else if (response.feed) { > if(! > (prefs.getString(webexsettings.WBX_EMAIL))) > { > prefs.set("email", > response.feed.getAuthors() > [0].getEmail().getValue()); > getData(); > } > } > } > > if(!(prefs.getString("email"))) > { > var feeduri = 'http://www.google.com/ > calendar/feeds/default/private/full'; > > calendarService.getSettingsFeed(feeduri,requestCallback,requestCallback); > } > else { > getData(); > } > > I only make this call once by checking a stored value in prefs which > is set after user has approved the gadget. Once approved I call my > getData() method which fetches data from my server using makerequest. > I also have a subscribeToEvents handler that detects when an event is > selected in which I call > calendarService.getCalendarEventEntry(gdataId, callback, > err_callback); > > My getData() method is called every 5 minutes and after an hour the > call to getCalendarEventEntry produces a 403 error. The error I get > just says "403 error" and nothing else. You mentioned that the token > could be expired but the example did not show how to refresh the > token. How do I check if the token has expired and renew it using > javascript? > > Thanks > Matt > > On Sep 14, 4:09 am, Alain Vongsouvanh <[email protected]> wrote: > > Hello Matt, > > > > Do you have a specific error message being sent with the 403 status code? > > The 403 might not be due to the quota being reached but because the token > > you are using has expired. > > > > Thanks! > > Alain > > > > > > > > > > > > > > > > > > > > On Tue, Sep 13, 2011 at 6:05 PM, MattG <[email protected]> > wrote: > > > Alain, > > > > > I am also running into this issue. I am calling makerequest to ping my > > > server for data every 5 min. I did a test where I sign in to my > > > calendar sidebar gadget and authenticate via OAuth. I then let the app > > > site for 1.5 hrs making a makerequest call to my server every 5 min. I > > > then select an event which calls getCalendarEventEntry. It fails and > > > returns 403 error. So in 1.5 hrs at 5 min intervals that is 18 > > > makerequests calls plus a dew to initially authenticate. Why am I > > > getting 403 errors/quota limit after at most 25 calls in less than 2 > > > hrs? > > > > > Thanks > > > Matt > > > > > On Aug 26, 5:20 pm, Mark L <[email protected]> wrote: > > > > Alain, > > > > > > The reason that I have a poll going out every minute is that the > gadget > > > > needs to check for when an event has already passed. In essence, the > user > > > > selects a couple of events to watch, and the gadget would display > that > > > those > > > > meetings haven't occurred yet. This needs to watch for when some of > these > > > > events do occur, and react to that. We're working on one of many ways > to > > > do > > > > this same check without polling Google incessantly, but I'd still > like to > > > > make sure that through regular usage this limit isn't hit. > > > > > > How high is the limit, exactly? Or even generally? Like I said, I'd > like > > > to > > > > be sure that the users of the gadget wouldn't hit that limit on > regular > > > > usage. Also, I'd like to know if the limit is just for Google Data > API > > > > calls, or for any Google APIs, or any calls to any external servers. > > > > > > Lastly, I just wanted to get your opinion on what else could cause > this > > > 403 > > > > error to keep crawling up. Are there any other triggers for Google to > > > return > > > > 403 to a request for information? Unfortunately, the error doesn't > give > > > any > > > > other explanation, so I'm left guessing at this point. > > > > > > Thanks a ton for the help! I definitely appreciate it. > > > > --Mark > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Google Calendar Data API" group. > > > To post to this group, send email to > > > [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group at > > >http://code.google.com/apis/calendar/community/forum.html > > > > -- > > Alain Vongsouvanh | Developer Programs Engineer > > -- > You received this message because you are subscribed to the Google > Groups "Google Calendar Data API" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://code.google.com/apis/calendar/community/forum.html > -- Alain Vongsouvanh | Developer Programs Engineer -- You received this message because you are subscribed to the Google Groups "Google Calendar Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://code.google.com/apis/calendar/community/forum.html
