Copy Event from One Calendar to another - asp.net

I am creating an app in asp.net for Google calendar integration. When we insert a particular event to the calendar then at the same point i want to copy the same calendar event in to another calendar and i want to do the same process in a single request. So may any one please guide me for this problem. I am using google calendar version 3 for this. Thanks in advance

Is it necessary that they be two separate Calendar events? If not, you should be adding the second calendar as an attendee of the event rather than creating a copy of the event. See the events reference and look for the attendees list attribute. This can be achieved in a single API call.
If it is indeed necessary that the events are entirely separate and independent of each other, it will require two events.insert() operations, one on each calendar. However, as long as the user you are authenticating as has access to both calendars, it should be possible to batch the two operations into a single HTTP call.

Related

How to find out deletion time of an event with CalDAV?

Problem description
I am using CalDAV to sync events between Google Calendar and my own calendar application. Right now i am trying to implement Deletion and Restore functionality:
Every time something is synced between my two systems, i write (meta)info about the synced event in a json file. So using that file i am able to tell in a particular moment which event were synced already and are not anymore present in the CalDAV side (Google Calendar in my current case, but could be any Calendar service that support CalDAV). So, telling if an already-synced event was deleted on the CalDAV side is no problem. Now i would like to know WHEN did the deletion take place.
What i have tried
So far i tried simply retrieving all events with
<?xml version=\"1.0\" encoding=\"utf-8\"?><d:propfind xmlns:d=\"DAV:\" xmlns:cs=\"http://calendarserver.org/ns/\"><d:prop><d:getetag /></d:prop></d:propfind>
But this only returns information about the existing (not deleted) items.
Also i tried retrieving the deleted event using its id with:
<?xml version=\"1.0\" encoding=\"utf-8\"?><c:calendar-multiget xmlns:d=\"DAV:\" xmlns:c=\"urn:ietf:params:xml:ns:caldav\"><d:prop><d:getetag /><c:calendar-data/></d:prop><d:href>{eventName}</d:href></c:calendar-multiget>
But this returns HTTP 404.
Does anyone know (or has any suggestion on) how to find out the deletion time of an event using CalDAV?
UPDATE
I found out that using Google Calendar API it is possible to retrieve a list of all the documents, and this list could include deleted ones by setting the property showDeleted to true.
But the question remains:
Does anyone know how could i implement something like this with CalDAV?
Deletion is a peculiarity of Google Calendar, and not necessarily supported by all other calendars, that is why it is not possible to obtain deletion information using just CalDAV.
You could use GoogleCalendar API to take advantage of the deletion information for that particular case while implementing CalDAV in your application: It would be something like Server-Specific functionality.

Add event on multiple attendee calendars in one go using google calendar event API

Is it possible to add events on multiple attendee calendars in one go using Google's calendar event API?
Events: import
Imports an event. This operation is used to add a private copy of an existing event to a calendar.
the key word here is an meaning one or single. Most calls in Google apis are done on a single object rather than more that one object.
You may want to check out batch method. Note: batching method saves bandwidth not api calls or quota usage.

How to delete orphaned Google Calendars + Events?

My app performs a one-way sync to Google Calendar. As in, if you create an event in my app it will be added to Google Calendar, but you can't update that event from Google Calendar.
I store all the Google Calendar IDs and Event IDs that their API gives me back so that I can update the calendars + events later.
However, I'm concerned about orphaned records. If, for example, someone deletes an event in my app but either the API request fails to delete the corresponding event from Google Calendar or my app has a bug in it, then that record will become orphaned -- it will exist on Google Calendar but I will have no reference to it.
So what's the best way to delete orphaned records?
Here are my ideas:
Download a list of every single event ID in Google Calendar, fetch all the event IDs out of my database, do a set subtraction to determine which ones are orphaned, and then delete those one-by-one.
Delete the entire calendar if I notice a mishap, and then re-sync all the events.
The problem with (1) is that it might get quite memory intensive once I've accumulated a lot of events. The problem with (2) is that a full re-sync can take awhile and those events will be missing from Google Calendar while the sync is happening. Plus, I might have a race-condition if users are creating new events during the sync.
What's the best approach? Are there any other solutions?

Creating a linked events in Google without using Recurrence Pattern

We are trying to implement a middle-ware application to synchronize the Google(App G) events and Our application(App A) events. The problem we are facing is in creation of recurrent events from middle-ware application to Google. The App A does not use ICS format for recurring events. Instead, it uses a concept of parent-child relationship between events to denote linked events. But while trying to insert this data in Google, we end up creating an individual event for each child event as we don't have any recurrence pattern to set in event before inserting.
We have tried to look at any solution to link the events as recurrent AFTER inserting the events to Google. But could not find any solution. Is there anything we can do to show the inserted events as linked? It would work even if the events are marked as
RecurrenceException(com.google.gdata.model.gd.RecurrenceException).
Solutions and suggestions are welcome.

How to post calendar event to participant's specific calendar

I am working Calendar API (Java).
My specific requirement is I want to add participant to event and at the same time want to specify the participants calendar.
Let us say I have 2 users. User-A and User-B
User-A is creating calendar event and adding User-B as participant
User-A's calendar is Cal-A and User-B's calendar is Cal-B.
Now when User-A adds User-B as participant, an event is created in User-B's calendar but is created in his/her static calendar. Is there is a way, how I can specify (using java api) that the invitation/ event created by User-B should go into User-B's Calendar-B?
Note: in the applicaiton program, I have access to both User-A' calendar and User-B's calendar.
Thanks in advance.
I believe the short answer is no...
Google Calendar, regardless of the API or the language you use, is based on the iCalendar standard, which, from my readings of it, does not have the concept of "Invite a participant and post event invitation on this specific calendar of that participant." If I'm wrong, the quickest way to get your answer and prove me wrong is to find evidence of such a feature in the iCalendar documentation.
I thought I had a workaround, which is "Hey, if you have access to person-B's calendar, why not just create the event on their calendar and add person-A as an attendee?" I did this by sharing one of my sub-calendars of one of my Google Calendar accounts with another. But sure enough, you get the same problem in reverse. Now person-B has the event in the right place, but person-A has it on their default calendar.
So depending on which is your "primary" account, you may want to go that route, but I'm guessing you find that about as appealing as what you're dealing with already.
The only other workaround I found (which was not all that great), is you can access Person-B's calendar and copy the invite to another calendar (the one you want), and then delete it from the main calendar. This will work (I tried it), but obviously it's not as graceful as what you had in mind. If you need specifics on how to copy/delete or how to access a specific non-default calendar, let me know and I'll post some examples.
It is possible (even if the solution isn't nice). If the person knows the ID of your other calendar (which is a valid email address), he can send the invitation to the email address. The ID can be found in the settings of the calendar and has the form ...#group.calendar.google.com.
Have a look at my other answer at a similar question for a list of drawbacks of this solution.

Resources