Posted by Iskander Akishev, Software Engineer, Google Calendar
The Google Calendar API allows you to create and modify events on Google Calendar. Starting today, you can use the API to also attach Google Drive files to Calendar events to make them—and your app—even more useful and integrated. With the API, you can easily attach meeting notes or add PDFs of booking confirmations to events.
Here's how you set it up:
1) Get the file information from Google Drive (e.g. via the Google Drive API):
GET https://www.googleapis.com/drive/v2/files { ... "items": [ { "kind": "drive#file", "id": "9oNKwQI7dkW-xHJ3eRvTO6Cp92obxs1kJsZLFRGFMz9Q, ... "alternateLink": "https://docs.google.com/presentation/d/9oNKwQI7dkW-xHJ3eRvTO6Cp92obxs1kJsZLFRGFMz9Q/edit?usp=drivesdk", "title": "Workout plan", "mimeType": "application/vnd.google-apps.presentation", ... }, ... ] }
2) Pass this information into an event modification operation using the Calendar API:
POST https://www.googleapis.com/calendar/v3/calendars/primary/events?supportsAttachments=true { "summary": "Workout", "start": { ... }, "end": { ... }, ... "attachments": [ { "fileUrl": "https://docs.google.com/presentation/d/9oNKwQI7dkW-xHJ3eRvTO6Cp92obxs1kJsZLFRGFMz9Q/edit?usp=drivesdk", "title": "Workout plan", "mimeType": "application/vnd.google-apps.presentation" }, ... ] }
Voilà!
You don’t need to do anything special in order to see the existing attachments - they are now always exposed as part of an event:
GET https://www.googleapis.com/calendar/v3/calendars/primary/events/ja58khmqndmulcongdge9uekm7 { "kind": "calendar#event", "id": "ja58khmqndmulcongdge9uekm7", "summary": "Workout", ... "attachments": [ { "fileUrl": "https://docs.google.com/presentation/d/9oNKwQI7dkW-xHJ3eRvTO6Cp92obxs1kJsZLFRGFMz9Q/edit?usp=drivesdk", "title": "Workout plan", "mimeType": "application/vnd.google-apps.presentation", "iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_11_presentation_list.png" }, ... ] }
Check out the guide and reference in the Google Calendar API documentation for additional details.
For any questions related to attachments or any other Calendar API features you can reach out to us on StackOverflow.com, using the tag #google-calendar.
Posted by Janet Traub, Program Manager, Google Apps APIs
The Google Apps Developer team recently hosted a 3-part Hangout On Air series that provided the developer community a unique opportunity to engage with the creative minds behind Google Apps developer tools. Each session covered topics ranging from business automation using Apps Script to Google Calendar API usage to creating Add-Ons for Docs & Sheets.
In the first installment of the series, Mike Harm, the creator of Apps Script and his colleague Kenzley Alphonse delivered a captivating session entitled, “Automate your Business with Apps Script.” Together, they reviewed the various features of Apps Script that can help developers build powerful solutions with Google Apps, such as simple scripts, to easily do a mail merge, export calendars into a Sheet, and to generate regularly scheduled reports.
The series then shifted focus to Google Calendar. In “Creating Calendar Events - Easy and Useful” Ali A. Rad (Product Manager) and Lucia Fedorova (Tech Lead) for Google Calendar API, explained how developers can benefit from injecting content into users’ calendars. In addition, they reviewed different approaches on Google Calendar to create events and meetings, such as API features, email markups, Android intents, Calendar import, and more.
We concluded the series with “How to Increase Traffic to Your Add-On with Google Apps Script.” This session, delivered by Apps Script Product Manager, Saurabh Gupta and Mike Harm, gave developers an in depth understanding of the Add-Ons framework, steps to deployment and strategies to increase adoption of their Docs, Sheets and Forms Add-Ons.
For more information on developing for Google Apps, visit developers.google.com/google-apps
If your app needs to keep up with changes in a Gmail mailbox, whether it's new mail being received or a label being added, you are likely familiar with periodically polling the Gmail API's history feed for updates. If you find this tedious, we have good news for you. Today, at Google I/O 2015, we're launching push notifications for the Gmail API.
Just subscribe to a Gmail mailbox and whenever a change occurs, the Gmail API will instantly notify your server using webhooks or another Cloud Pub/Sub API notification method. No polling required.
Check out the developers’ guide at https://developers.google.com/gmail/api/guides/push to get started. We can’t wait to see what you build.
Posted by Eric DeFriez, Gmail Extensibility Team. As a technical lead for Gmail APIs, Eric works to make it easy for developers to build on top of Gmail.
Posted by Saurabh Gupta, Product Manager
Originally posted to Google Developers blog
Back in 2014, we introduced add-ons for Google Docs, Sheets, and Forms in developer preview. Since then, the developer community has built a wide variety of features to help millions of Docs, Sheets and Forms users become more productive. Over the last few months, we launched a number of developer-friendly features that made it easier to build, test, deploy and distribute add-ons. Some key capabilities include:
With these features under our belt, we are ready to graduate add-ons out of developer preview. Starting today, any developer can publish an add-on. To ensure users find the best tools for them, every new add-on will undergo a review for adherence to our guidelines before it’s available in the add-ons store.
We can’t wait to see what you will build!
Posted by Chris Han, Product Manager, Google Apps Marketplace team
Today we’re announcing two changes to the post install experience for Google Apps Marketplace. Both changes are geared towards improving end user awareness and active usage of your apps.
First, after installing a Marketplace app, admins will be given the opportunity to send a notification to end users. This enables admins to easily tell users that your app is now available, and how to access it.
The notification will only appear to the users in the Organizational Unit (OU) or domain for which the admin has installed the app. The notification will appear in each user’s Notification Center and will describe how to access and launch the app.
Second, we’ve completely changed the post install experience itself, making instructions for accessing your app clearer. During the post install experience, we now show how to access all the extension points of your app (e.g. Apps launcher, Drive, Add-ons to Docs, Sheets, and Forms).
For more information on this feature, please see the Help Center article.
Posted by Cheryl Simon Retzlaff, Software Engineer on the Realtime API team
Real-time collaboration is a powerful feature for getting work done inside Google docs. We extended that functionality with the Realtime API to enable you to create Google-docs style collaborative applications with minimal effort.
Integration of the API becomes even easier with a new in memory mode, which allows you to manipulate a Realtime document using the standard API without being connected to our servers. No user login or authorization is required. This is great for building applications where Google login is optional, writing tests for your app, or experimenting with the API before configuring auth.
The Realtime debug console lets you view, edit and debug a Realtime model. To launch the debugger, simply execute gapi.drive.realtime.debug(); in the JavaScript console in Chrome.
gapi.drive.realtime.debug();
Finally, we have refreshed the developer guides to make it easier for you to learn about the API as a new or advanced user. Check them out at https://developers.google.com/drive/realtime.
For details on these and other recent features, see the release note.
Posted by Kalyan Reddy, Developer Programs Engineer
Apps Script includes many built-in Google services for major products like Gmail and Drive, and lately, we've been working to add other APIs that developers have been clamoring for as advanced Google services. Today, we are launching seven more advanced services, including:
Like all other advanced services in Apps Script, they must first be enabled before use. Once enabled, they are just as easy to use as built-in Apps Script services -- the editor provides autocomplete, and the authentication flow is handled automatically.
Here is a sample using the Apps Activity advanced service that shows how to get a list of users that have performed an action on a particular Google Drive file.
function getUsersActivity() { var fileId = 'YOUR_FILE_ID_HERE'; var pageToken; var users = {}; do { var result = AppsActivity.Activities.list({ 'drive.fileId': fileId, 'source': 'drive.google.com', 'pageToken': pageToken }); var activities = result.activities; for (var i = 0; i < activities.length; i++) { var events = activities[i].singleEvents; for (var j = 0; j < events.length; j++) { var event = events[j]; users[event.user.name] = true; } } pageToken = result.nextPageToken; } while (pageToken); Logger.log(Object.keys(users)); }
This function uses the AppsActivity.Activities.list() method, passing in the required parameters drive.fileId and source, and uses page tokens to get the full list of activities. The full list of parameters this method accepts can be found in the Apps Activity API's reference documentation.
AppsActivity.Activities.list()
drive.fileId
source