I am creating a system which manages freight shipments for my client. Part of this system is to create Google Calendar events for the different deadlines for each shipment.
I am using the Google Client Library for PHP. Every event I create displays the service email address as the creator. I would like to instead display the name of the system. I know that I can emulate a different account through OAuth, but this seems like it should be unnecessary. I'm sure there are a lot of systems out there that generate and manage events and to create two accounts just to have a user-friendly name seems like a hack-ish solution.
Related
I am trying to add a feature to my website that allows users to add an event created on the website to their calendar.
Basically the app allows users to schedule a meeting and after which the meeting is sent to the mail of members of the site. What I want to do is to add a link with the meeting details to the site so users can click on it to add the event to their calendar, majorly google and office 365 calendars.
I have tried initially with google calendar apis but I can't seem to figure out what to do with the apis given. I was going to try with schema (with reference from google calendar api) to allow users to execute click actions but I realized it wont allow me to add events to the calendar but could be used to trigger certain actions which is not what I need at the moment.
I am building the app with laravel and can send the markdown email alright just need to be able to allow users a click action to add events to their calendar.
Thanks in advance.
Lance, the action taken when an ics file is clicked upon depends on the users application and their personal setup. For example on my desktop I have it set that a .ics file will be opened in notepad++, whereas my iphone will have a more standard response. Then in Google for example it will automatically show events in google calendar that it has found in my gmail emails.
Other than sending the .ics in email, Some other things you can do:
offer a 'Add to Google Calendar' button with html link. More info here: Link to add to Google calendar. This prompts add to default calendar.
Example:
http://www.google.com/calendar/event?action=TEMPLATE&text=Friday%20Drinks&dates=20200501T080000Z/20200501T090000Z&location=407%20King%20St,%20Newtown%202042&trp=false&details=Regular%20Friday%20Night%20Get%20together%20at%20Earls%20Juke%20Joint
OR
offer a subscribable link on the website, unique to each user, of all meetings arranged. Once they have subscribed they will automatically see new ones. These would show in a separate calendar though.
I'm not aware of an Outlook 365 equivalent of the google 'TEMPLATE' - possibly they just go with the single event .ics.
You could use ics files, which are supported on most platforms.
A sample PHP Library is https://gist.github.com/jakebellacera/635416
I have created a code which generates .ics to synchronize events from my application to other calendar system like google, mac-ical, outlook etc.
I add url to these systems and all events from my application get synchronized.
This code does work fine but problem is event doesn't get synchronized instantly, it takes time to fetch events automatically.
So I want to make all events to get pushed to all subcribers, so that they get instantly updated, many applications do provide such things, in that I get instant update to my iCal on creating event.
So that is possible, I want to know how can I do it using php language, what technology I need to push events, instead of auto fetching by calendar system.
It will get general push to all subscribers not for any particular system like google calendar, I know it does have its own API.
I have a restaurant reservation website build with Laravel and running for merchant and customer.
What I would like to do is, when customer successfully booked at merchant's restaurant, I would like to sync reservation data to "merchant's google calendar" as well as "customer's google calendar".
Is it possible to do with Google Calendar? If so what's the approach to do that?
What would be the seamless approach to sync data between their own calendar and my calendar (from my website)?
As far as I understand your use case from the comments, you actually need to do two different things:
1. Keep the merchant's calendar up to date
For this, a sync might indeed be the best solution. A Calendar API "sync" is just a usual read operation which includes a sync token you can use in later reads to reduce the number of needed operations. It is described in the docs.
2. Add the event to the customer's calendar
You do not want to sync your calendar with the customers' calendar here, just add one event. Of course, you can add an event via the API; however, a much better solution seems to be providing a link for the customer to add the event himself:
https://www.google.com/calendar/render?action=TEMPLATE&text=Your+Event+Name&dates=20150998T224000Z/20150998T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml
It is much easier technically, and the customer does not need to give you full access to his calendar (there is no write-only permission).
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.
We have developed a calendar for our extranet. Each week we update it with next week's courses schedule for all teachers and students of the school. This also triggers the sending per email of ICS files to those users who chose that option.
Now, it almost always happens that there are last minute changes, so a need to do a new schedule update, hence a resend of the updated ICS.
Question: for the moment the user has to manually delete the events already imported into its calendar application. Is there a way for us to add some DELETE or UPDATE events into the user's calendar? Does the ICS format allows that?
Once you get into trying to do updates or deletes (cancel) you are going beyond the iCalendar file format and entering the wonderful world of iCalendar Transport-Independent Interoperability Protocol (iTIP) and iCalendar Message-Based Interoperability Protocol (iMIP) see the Guide to Internet Calendaring tools.ietf.org/html/rfc3283
The best solution will depend on your clients system/s. If you are delivering calendars rather than individual events I would recommend going away from e-mail delivery and using a subscription model. Here is an example of a University doing just that, icalshare.com is another example. Obviously if you wanted personalised timetables you would need personal urls. You could fairly simply just publish the files you are currently sending by email to the web.
If you use the webcal:// instead of http some calendar clients e.g. Outlook 2007 will open it automatically and then keep it updated.
If you don't want to use the subscription model and responses from clients are required I know that Outlook 2007, Windows Live Calendar and Google calendars can all talk iTIP/iMIP to each other, unfortunately I can't find a good list of other clients that do. Apparently Thunderbird 3 was going to but it has been dropped (it will still require the lightening plugin).