• Hi,

    I have created a walldisplay for our private calendars which show us our agenda for 5 weeks ahead.
    I have set the browser (through an extension) to refresh the page every 15 minute so new events will be added to the calendar.
    The problem I have is that sometimes after a refresh of the page all calendars disappear and a red box at the top is displayed with the text:

    “Invalid Credentials. Invalid authorization header. The access token you’re using is either expired or invalid.”

    I have tried to search this forum, google it and read through fullcalendar docs but I have no idea why this is happening and have no idea how to fix it.

    Do you know how I should be able to update the calendar when new events is added by someone?

    Thanks

    • This topic was modified 5 years, 8 months ago by anasazi.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author michielve

    (@michielve)

    Hi,

    To know what’s going on I would like to know something more:

    – From your description I suppose you use OAuth2 credentials and not an API token can you confirm this?
    – Do you know when this error begins to show (after an hour, day, week)?
    – Is it solved automatically after some time or do you do something?

    BW,
    Michiel

    Thread Starter anasazi

    (@anasazi)

    Hi,

    Thank you for your replay.

    I’m using private calendars and has been following this guide:

    Create a project in the Google API console.
    Enable the Google Calendar API.
    Go to Credentials and create a new Client-ID OAuth credential1.
    Choose Webapplication for the type.
    Add the authorised redirect URI. Make sure to copy and paste the redirect URI you see in the Private Google Calendars settings page in the orange box exactly as displayed, otherwise it will not work.
    Click on Create and download the client secret JSON file.

    My browser automatically launches the website and now I’m using an extension that refreshes the page with an 15 min interval.
    The first time when the the browser start and opens the page it shows all my calendars correctly. The error shows up maybe the second or the third time when the browser refreshes the page and is probebly resolved at the next reload of the page.

    I have also tried to add the following into the head section of the html file but with the same result:
    <meta http-equiv=”refresh” content=”30″>

    Plugin Author michielve

    (@michielve)

    From your answer it looks like some caching issue.

    Maybe you can add a timestamp parameter to the page that changes every time you refresh, for example: mysite.com/mycalendar.php?timestamp=1234567, that way you may can disable the caching from the browser.

    If that doesn’t solve it, maybe you can try to manually refresh the page and see if your problem still exists. If not, than it is something in the refresh plugin.

    Thread Starter anasazi

    (@anasazi)

    Hi again,

    I just want to follow up on this problem that I have…

    The plugin I have been trying has a function that clear the cache at every reload but that did not help.
    So instead I tried to implement your suggestion to have a timestamp at the end of the URL. So this is the code I’m now using:

    <script type="text/javascript">
    (function(){
       setTimeout(function(){
    	 var timestamp = Date.now();
         window.location=<code>http://address.to.website?timestamp=${timestamp}</code>;
       },900000); /* 1000 = 1 second*/
    })();
    </script>

    This reload redirect the page to the same address every 15 minutes with the current timestamp at the end. The redirect works but the problem still exists that I sometime get the error message.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Refresh calendar’ is closed to new replies.