Creating a Google Calendar remotely - php

I've been researching this question for the last few weeks and have had no success trying to connect to Google through OAuth1 OR 2.
I have a client that needs a separate Calendar for each of the homes they are building. On creation of a new home in the database, I want to create a calendar and save the Id of the created calendar.
What options do I have to do this?
It seems like the only way is to have the user get redirected to Google and login to add a calendar... I want to use a static Google account and simply create the calendar that way, without having the annoying "Login to google" screen.

Google api lets you to do whatever you need with a Calendar using their provided libraries. Let's take a look: Google Developer: Instantiate Google Calendar

This SO posts discusses that. Specifically pay attention to the line in the accepted answer where it is mentions the process for adding a new calendar is similar to adding an event.
SO: Google Calendar API Selecting and creating Calendars
I also came across this tutorial which may be helpful in terms of other actions on the calendar once it has been created.
IBM Developer Works: Integrate your PHP Application with Google Calendar

Related

Google calendar reminders

I have a Laravel 5 project and I create event on google calendar with larvael-google-calendar.
I need to create reminder but not reminder of an event (so not the notifications to remind an event). The reminder you can create on Google calendar.
This :
Which look like this after created :
And not this
But I don't find anything on it, when I research I always find results concerning the reminder like a notification.
Anybody know how to create it with the API or another method (PHP of course)? (I don't care if I need to remove my package, just want a solution).
I have actually looked around for this for a long time. This is the conclusion i have come to.
The reminders you are speaking of arnt actually part of Google Calendar they are more part of your full Google account as far as i have been able to tell.
You can for example create a reminder though the Google assistant, Google Calendar android app and the Gmail android app as far as i have seen so far.
It appears that this works across multiple applications there for IMO this is not directly part of Google calendar and thats why we cant seem to find an option for adding remainders from within the Google Calendar api.
I think we will have to wait for Google to release a new API for this.

Proper Method for Google Calendar with PHP

I am working on a website for my organization which will allow users of the website to create/modify/etc room reservations for a number of spaces in our building.
Each room has a Google Calendar which links to several monitors around the building to display what rooms are [un]available. So, my goal was to utilize these calendars by having the website I am creating edit these google calendars. The problem I am having however is that from all the documentation I have been able to find, it looks like you have to prompt each user for Google Log-In. This is what I am trying to avoid. I want individuals to be able to log-in to my website, and then on the backend my website provides the authentication to Google so that they can add/edit/remove events from the aforementioned GCals based on permissions on set on their account.
Can anyone help direct me to the proper documentation? I've found a couple of things through some intensive Google-ing of my own, but I've become extremely confused about what method I should be using.
Any assistance in getting things rolling is appreciated!
If I understand it correctly, the concept that you want is to create a website that writes into your own calendar and not on the users calendar. Exactly what this 3 part tutorial of Sample Web Page for Booking gives:
Part 1: Setting up Google Calendar
Part 2: OAuth2 and Configuring Your ‘Application’ With Google
Part 3: A Sample Web Page For Bookings
This tutorial worked for many like what has been done in this SO post - How do I connect to the Google Calendar API without the oAuth authentication?.

Integrating Outlook Calendar to Website / Other

When the users add events to the online calendar they also can be added to the outlook calendar (synchronize). Obviously a site built using PHP can not integrate with desktop application directly, so I am looking alternative options.
Options I found:
Using PHP ICAL library creates an .ics file and the user can download it and install. Not the most user friendly way of doing it, might work.
Use SharePoint or exchange server- but have no previous experience working Microsoft technologies, so it not ideal.
Use Google Calendar and Zend Library (gdata), create online calendar and add events to that. Then using Google Calendar Sync tool the user can sync the online calendar to outlook. But the problem here is the all users need a gmail account to use the Sync tool, it not ideal when you have thousands of users on the site. Unless I create one global gmail account and create many calendars on that account, if that even possible.
Questions:
Are there any outlook plug-ins paid or free (ideally) that can achieve this?
Are there any web service/ APIs that can achieve this?
Any other ideas or solutions?
Office 365 comes with an REST API that can be used to read/write to calendars.
Here's some documentation on this. http://msdn.microsoft.com/office/office365/api/calendar-rest-operations
Alternatively, the EWS Managed API might be able to help you: http://msdn.microsoft.com/en-us/library/office/dd633696(v=exchg.80).aspx and
http://msdn.microsoft.com/en-us/library/office/dd633702(v=exchg.80).aspx
you could do this by having the outlook subscribe to the online calendar.
with phpicalendar you can have other clients subscribe to your calendars (here)
you may want to tweak the generated .ics file to include X-PUBLISHED-TTL - Recommended update interval for subscription to the calendar
To get the calender event follow these step:
Sign in to Calendar
On the toolbar, click Share
Select the calendar that you want to export/embed.
Click Get a link.
Under Show event details (click Create)
Note: If step number 5 is already performed, just skip it and click Link to event details
Copy the link that you needed and paste it on the desired program/website.
Use EWS exchange webservice to achieve this.
If it is a website with a no. of users u will need to create OU in exchange server and add a admin user who has read permissions to all accounts in the DL.
EWS exposes endpoints where in u can fetch the calendar mail add read and do all kind of operations.
Building off Rahul's idea but using a different approach - Microsoft provides something similar to a "RSS feed" that auto updates each time you GET the URL, except it's an feed of "ICS" event data:
Open up Outlook Web Access (OWA), e.g. if you are using a microsoft.com account the URL might be https://outlook.live.com/calendar/ (if you are using some other Microsoft 365 account the URL may be different)
On the top right, click the Settings icon
Click View all Outlook Settings
Click Calendar > Shared Calendars > and under Publish a calendar, select the calendar, then under Select permissions, choose as appropriate, then click Publish
It will give you HTML and ICS links. Copy the ICS link URL.
Use your favourite programming language/tool/software to periodically do a HTTPS request (using CURL or AJAX or some other HTTP fetch) using GET method to the URL you got in step 5. You will get back a bunch of calendar data in ICS format. Use this however you need. You may be able to find some pre-written code from elsewhere that parses ICS data for you, or you can manually create your own parser code if you have to.

Avoid event duplication when synching custom calendar to Google Calendar?

I have successfully saved all the events from my custom calendar to Google calendar with PHP script. But whenever i try to sync same calendar again, i see all the events are recreated & duplicated. Is their any Google Calendar API clue that might help remove the duplication?
Please help.
Regards.
I am asuming you are using the iCal interface.
We did a similar implementation a while back (not using php but anyways).
What we used to keep this duplication away was that after we had created a new event in the google calendar we fetched from google and found this event. Then we keept track of the "CREATED" part of the iCal file that we got back from google, and simply used this as a reference to know both what have been synced and to be able to link items in google calendar and our side.

Zend Framework Project - Calendar: Need web calendar with events (like google calendar) for every user separately

I doing multi users website (it should works for more than 100,000 users) with Zend Framework.
I need to create event calendar like google calendar (If it was possible to use google calendar i will do it- please tell me).
I have to do that from zero or exist some good Calendar that will work well with Zend?
Thanks
Check out full calendar by Arshaw.
This is a jQuery plugin that provides a full-sized, drag & drop calendar just like google calendar. one can also customize it easily.
Full Calenadar Link.
There are some calendars proposals on ZF, e.g. this Zend_Calendar proposal. You can easily extend it with Google Calendar as a data provider.
Take a look at alternative to Google Calendar, written in jQuery: wdCalendar as well.
If you want to do it with Google Calendar, have a look at Zend_Gdata:
Google Data APIs provide programmatic interface to some of Google's online services. The Google data Protocol is based upon the » Atom Publishing Protocol and allows client applications to retrieve data matching queries, post data, update data and delete data using standard HTTP and the Atom syndication formation. The Zend_Gdata component is a PHP 5 interface for accessing Google Data from PHP. The Zend_Gdata component also supports accessing other services implementing the Atom Publishing Protocol.
Specifically the chapter on Using Google Calendar:
You can use the Zend_Gdata_Calendar class to view, create, update, and delete events in the online Google Calendar service.
Also see http://code.google.com/apis/gdata/ for more information about Google Data API.
Also see the answers to these questions:
Know of any open source Zend Framework calendar?
Which PHP calendar will suit my needs? Or build my own?
Calendar using Javascript/ PHP/ mySQL
I think that you could use Google Calendar Api. You would need to create a calendar for each user using Calendar Data API. And when a user is logged show him his calendar in a google calendar embed. I didn't try that, but I will try tomorrow. If it is not posible I will let you know.

Categories