Posted by Hodie Meyers, Product Manager, Google Drive and Steve Bazyl, Developer Programs Engineer, Google Apps
Last year, we announced the deprecation of Google Drive web hosting for users and developers, and that the service will be shut down on August 31, 2016. We’d like to remind remaining users that websites hosted via googledrive.com/host/[id] will become unavailable from that date.
googledrive.com/host/[id]
For those who haven’t switched yet, please consider the following alternatives.
Posted by Posted by Wesley Chun (@wescpy), Developer Advocate, Google Apps
Seasons greetings! In case you missed it last week, the Google Drive team announced the release of the next version of their API. Today, we dig deeper into details about the release with developers. In the latest edition of the Launchpad Online developer video series, you'll get everything you need to know about the new release (v3), as well as its relationship with the previous version (v2).
This jam-packed episode features an introduction to the new API, an interview with a Google Drive engineer about the API design and a code walkthrough of real source code you can use today (as with all my Launchpad Online episodes). This time, it's a command-line script that performs Google Drive file uploads and downloads, presented first in v2 followed by a how-to segment on migrating it step-by-step to v3. In addition, the uploading segment includes the option of converting to Google Apps formats while the download portion covers exporting to alternative formats such as PDF®.
To get started using the Drive API, check out the links to the official documentation above (v2 or v3) where you’ll also find quickstart samples in a variety of programming languages to the left. For a deeper dive into both Python code samples covered here, including v3 migration, start with the first of two related posts posted to my blog.
If you’re new to the Launchpad Online, we share technical content aimed at novice Google developers -current tools with a little bit of code to help you launch your next app. Please give us your feedback below and tell us what topics you would like to see in future episodes!
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.