问题
I am using Google API Version 2 fo .NET to create Google Calendar Entries. How can i add "Attachment" to Google Calendar?
Thanx
回答1:
I was trying to find the answer to this question myself, and after looking through the XML results for various queries using the Calendar API feeds, I'm pretty sure there isn't currently a way to retrieve or update file attachments. Since calendar event file attachments is a lab feature from Google, it's not entirely surprising that they aren't yet available through the public API.
Depending on what you are trying to do, you could use extended properties to store additional information about attachments in an event, but these values won't be read by the calendar web client, so you would only be able to use them for your own application.
A couple other things (admittedly hacks) you could try:
- The ICAL feed provided by Google Calendar provides an ATTACH: property. You could have your app use the import url to import an ics file containing your attachment.
- You could simulate the web client, which posts a gdoc-attachment parameter to update an events with an attachment.
You also might try posting to the calendar help forums. The only related post I could find was here.
Good luck!
回答2:
For all the future generations reading this, the attachments are now supported, here is the guide on how to do it: https://developers.google.com/google-apps/calendar/create-events#attachments
来源:https://stackoverflow.com/questions/3094324/how-to-add-attachment-in-google-apps-calendar-using-google-api-version-2