Google calendar reminders - php

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.

Related

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?.

Creating a Google Calendar remotely

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

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.

Google Calendar sync with php in 2 ways

I am creating a php website that uses the Google Calendar API. It's working fine with Create, Update and Delete: any event from the PHP website goes into my Google Calendar events after login.
Events created on my site are created in Google Calendar.
What I want now that is: when I create an event from my test page it goes into Google Calendar after login, then if I update or delete that event from Google Calendar then it should automatically update or delete the php website event.
Basically: 1-way sync is working fine but now I want 2-way synchronization.
If anybody has any ideas then kindly share with me, it will be much appreciated.
There are no application hooks in Google Calendar (gCal) that allow you to trigger an action when an event is deleted. Instead you must either poll gCal at intervals (this could be a cron job every few minutes/hours) and update your calendar accordingly, or any time you perform an action from your calendar have a 1 in X possibly of a full re-sync.
This implies that you are using the gCal as the definitive source, and mirroring those changes back to your local application.
well, after following these answers and building a hole 2 way sync process,
i realized there's a push notifications for calendar since 2013.
you will still need a full sync process because the push notification only notifies about a change but no data about the change.
hope it will save you some time.
Push Notifications
Would it not be an option for your system to generate an iCal output at a special, user-specific URL, and then have the user subscribe to that calendar in Google Calendars (or their iCal-reading calendar of choice)?
That way, your system would always hold the authorative calendar, and Google Calendar would reflect any changes you make automatically.
Alternately, if you are wanting changes in the Google Calendar to be reflected in your application, then you may be able to subscribe to iCals for the User's Calendar, and then poll them at a regular interval to reflect any changes the User has made at that end.
I would lean towards the first option (your iCal subscribed through Google Calendar), as it is a simpler and easier solution.

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.

Categories