Monday 16 December 2019

Google Calendar API Tutorial #2 | Access Different Calendars Using PHP



Download VENDOR Folder (Only for PHP version 7.2+): https://unpossiblepog.com/research-and-development/php/Vendor-Folder-For-Google-Sheet-Drive-Calendar-With-PHP-Version-7.2-And-Onward

Hello guys, this tutorial was requested by one of my viewer who asked me how to access different google calendar other than “primary”.
Before we even start, if you don’t know how to connect PHP with Google Calendar, then click the link which is at right top corner or link is given in description.
Now, according to google, “Different Calendar” doesn’t mean they display different “user interface for different calendar”, but rather they display single page and display different color box for different calendars.
So let’s create a new calendar.
Then go to code that we created in previous tutorial, as you can see, the calendar-id is set to primary which is always the first one in the list.
If we run, the events will be display from primary calendar.
So let’s create new event of newly created calendar. Make sure that it is held in future.
After that, click on three-dots of new calendar, click on “settings and sharing”, scroll down and copy calendar-id.
Paste it at the place of calendar ID.
Then, refresh it and you will get your events.
That’s only it.
Thanks for watching.

No comments:

Post a Comment