Attach Google Drive files to Calendar events with the Calendar API

Attach Google Drive files to Calendar events with the Calendar API - Hallo sahabat Testagk.blogspot.com, Pada sharing kali ini yang berjudul Attach Google Drive files to Calendar events with the Calendar API, mudah-mudahan isi postingan yang saya tulis ini dapat anda pahami.

Posting : Attach Google Drive files to Calendar events with the Calendar API
Judul : Attach Google Drive files to Calendar events with the Calendar API

lihat juga


Attach Google Drive files to Calendar events with the Calendar API

Originally posted to the Google Apps Developer blog

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.



Demikianlah Artikel Attach Google Drive files to Calendar events with the Calendar API

Sekian posting Attach Google Drive files to Calendar events with the Calendar API, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sekian postingan kali ini.

Anda sedang membaca artikel Attach Google Drive files to Calendar events with the Calendar API dan artikel ini url permalinknya adalah http://testagk.blogspot.com/2015/06/attach-google-drive-files-to-calendar.html Semoga artikel ini bisa bermanfaat.

0 Response to "Attach Google Drive files to Calendar events with the Calendar API"

Posting Komentar