I want to create events in my own google Calendar through PHP API.
Should I use Google Service Account for that ?
I have followed google tutorials, and setup a service account , and
created code to insert events into my calendar. The code is working
fine, the events are not appearing on my calendar.
It seems using service account, it's sending events to some other calendar belonging to the service account , but not to my own calendar.
Note: I have a web application, I just want to send some events in to my own google calendar ( not any other user's just my own single calendar).
What I found so far is that using Service account is the right approach if you want to edit your own google calendar entries through API.
But you need to give permissions to the service account for the calendar you wish to work on using google Calendar settings.
To give permission to service account, you just need to add the service account email ID (auto generated , when creating a service account) on the google calendar settings page , under "permissions" section.
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 had successfully able to access data of domain users using a service account which is having domain wide delegation authority .
Now I want to access calendars of my domain users using the service account .
Questions I have is , is it possible to do this thing ? does it possible to access my domain users calendar without they have to share that calendar with me using service account .
I'm working in a Real estate project where users/agent can book slots of listings that they are gonna host this event and the same will be get added to their google calendar , they can also remove the event . - THIS IS WORKING FINE as users are logged in using there own gmail account so they can add/edit there calendar .
But now if I have a super admin right , want to edit/assign/delete these events from there calendar .
So ,is it possible ?
This is how i'm using service account
<?php
$client = new \Google_Client();
$authArray = array(
'https://www.googleapis.com/auth/admin.directory.user',
'https://www.googleapis.com/auth/admin.directory.group',
'https://www.googleapis.com/auth/admin.directory.resource.calendar'
);
$client->setApplicationName('appicationname');
$client->setScopes($authArray);
$client->setSubject('emailp#domain.com');
$client->setAuthConfig(public_path('path to json file service account .json'));
?>
Thanks
(Working in PHP/Laravel)
You may refer with these SO posts:1 and 2. The code should use service account to "impersonate" the domain users one by one, rather than trying to share calendars with service account. Also, you need to follow the steps for Delegating domain-wide authority to the service account in google domain admin console, and add the right scope (for calendar, it is https://www.googleapis.com/auth/calendar).
I'm using Google API PHP Client, to manage my Google Calendar in a web app.
It appears the reminders set through Google Calendar, get re-send by the API class. So I get 2 different notification emails for the same reminder. One is from Google itself, the other is a very simplified plain-text from the API class (I think). The sender from the 2nd one is the email address registered with the Calendar API app.
How do I disable these extra email notifications from the API class?
Edit: Removing the reminder via Google Calendar, also disables the extra reminder from the API class. So it's linked, obviously.
I have created iCal event by using iCalcreator. I want to make the google calendar so that it syncs automatically. I can create the .ical file that I will be importing or adding by URL. After I login into Gmail it is working. How can I make my events to automatically add to calendar by using the URL dynamically?
would the feature under
other calendars
>import by URL
be what you are looking for?
provided your URL always points to the up to date calendar your google calendar will always be up to date (down to the synch frequency of google calendar) and you or anyone who you shared you google calendar url with will have access to it
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.