1

How to move Google calendar event to another person calendar? I tried with Google move API but Unfortunately I am getting 404 not found error.

reference: https://developers.google.com/google-apps/calendar/v3/reference/events/move

Any Idea on this?

Matt
  • 14,906
  • 27
  • 99
  • 149
Santosh Khavekar
  • 597
  • 1
  • 6
  • 22
  • posible duplicate of http://stackoverflow.com/questions/31959576/google-calander-api-move-event – abielita Feb 18 '16 at 06:06
  • hey,I tried with same thing in which they suggested.But I am continously getting this error, { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } } – Santosh Khavekar Feb 18 '16 at 12:53
  • I upvoted your question because I'm similarly stuck with a 404. But I think you and Luc could both improve your answers here because neither are clear. By the way, if you want an amazing community like StackOverflow to thrive, it would be best to give points to someone who leads you to a resolution. (I see that Luc helped you over the course of *many* comments, and then you accepted your own answer instead of his.) – Ryan Sep 26 '17 at 14:23
  • The answer for me was this: https://stackoverflow.com/a/46429946/470749 – Ryan Sep 26 '17 at 15:04

2 Answers2

0

To perform move, the authenticated user needs to have at least write access to both, source and target calendars.

luc
  • 3,642
  • 1
  • 18
  • 21
  • Authenticated User have write and read access for the source calendar by writing scope like this https://www.googleapis.com/auth/calendar (read/write access to Calendars) but How to give write access to target calendar ? – Santosh Khavekar Feb 19 '16 at 10:19
  • 1
    There are two ways. No.1 go to the web UI for the target calendar and share it with write access to the user you want to use for move. The second way is to authenticate as the target's calendar owner in the API and perform an insert of a "writer" ACL through the ACL collection https://developers.google.com/google-apps/calendar/v3/reference/acl/insert – luc Feb 19 '16 at 12:39
  • Thanks for answer.I tried with https://developers.google.com/google-apps/calendar/v3/reference/acl/insert ,to write access to the target calendar ,the calendar event is moving to targeted calendar emailId.after that is it neccessary to use Move API again? – Santosh Khavekar Feb 22 '16 at 08:19
  • Yes, you still need the move API to perform the move itself. – luc Feb 22 '16 at 08:23
  • Can you tell me how to perform with move api ? Actually I am trying in Google Console here https://developers.google.com/google-apps/calendar/v3/reference/events/move and after giving write access to Target Calendar then also I am getting same error i.e 404 not Found. – Santosh Khavekar Feb 22 '16 at 08:35
  • Hi luc,I have been trying from last two days since I am not able to do it work properly still I am getting same issue only.Please can you point out me a good way to achieve this. – Santosh Khavekar Feb 24 '16 at 11:46
  • Hi Santosh, this is really hard to debug with this little information. You could copy-paste the queries from the API explorer showing what you did when you granted the access and what you do when calling the move. Is it possible your target calendar is inside a domain, which has domain restrictions on maximum sharing allowed? – luc Feb 24 '16 at 21:40
  • hello luc,I did it for granting target calendar Access like , https://www.googleapis.com/calendar/v3/calendars/calendarId/acl QueryPassed: { "role":"writer" "scope": { "type":"user", "value":"TargetdEmailID" } } – Santosh Khavekar Feb 25 '16 at 04:07
  • hello luc,I did it for granting target calendar Access like , https://www.googleapis.com/calendar/v3/calendars/calendarId/acl QueryPassed: { "role":"writer" "scope": { "type":"user", "value":"TargetdEmailID" } } Response: 200 OK - SHOW HEADERS - { "kind": "calendar#aclRule", "etag": "\"00001456373574183000\"", "id": "user:khavekarsantosh91@gmail.com", "scope": { "type": "user", "value": "khavekarsantosh91@gmail.com" }, "role": "writer" } Then I checked in Targeted calendar ,here especially all events of source calendar are showing . – Santosh Khavekar Feb 25 '16 at 04:19
  • as you told earlier ,we need to Move Api to perform the move itself.so I tried that one like https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId/move Query: calendarId:"SourceCalendarEmailId", eventId:"h97q426sglc4dfgqt5r1lj0grk", destination:"TargetedCalendarEmailId" I tried all this in Google API explorer .Hope you can understand this one. – Santosh Khavekar Feb 25 '16 at 04:21
  • 1
    This is wrong: { "role":"writer" "scope": { "type":"user", "value":"TargetdEmailID" }. You'll need to log as the target calendar and share with the source. – luc Feb 25 '16 at 09:57
  • 1
    You are performing this operation on the wrong calendar. Again, you will need to log in as the targetCalendar's owner and insert an ACL for the target calendar to give write access to the sourceCalendar's owner. – luc Feb 25 '16 at 13:34
  • Thank you luc for your full support.Yes Now I am able to do move calendar event.I will update the Answer.Thanks a lot once again. – Santosh Khavekar May 03 '16 at 07:08
  • Hi luc,I tried with Instant event it is working.same thing I tried with Recurring event but is giving error as { "error": { "errors": [ { "domain": "calendar", "reason": "cannotChangeOrganizerOfInstance", "message": "Cannot change the organizer of an instance." } ], "code": 400, "message": "Cannot change the organizer of an instance." } } How to do same for chnage organiser for only one instance in recurring event ? – Santosh Khavekar May 03 '16 at 08:10
  • It's not allowed to change organizer of one instance only. – luc May 08 '16 at 16:05
  • Okay Thank you Luc..we can do it by deleting the one instance and need to create new by making new Organiser. – Santosh Khavekar May 16 '16 at 04:05
  • Yes, you can do it that way. However, this new instance will not be updated if you make an "all-following" or "all" change on the recurring event. – luc May 17 '16 at 17:40
0

*Solution*:- For Moving Calendar Event from One calendar To another or Change Organiser.

Using ACL API: Call Acl API with Targeted Email by passing the fields,

calendarId: Primary,
scope:{
 type: user,
 value: Source EmailId
}

Using Move API: Call move Api with Source Email by passing the fields,

calendarId: Primary,
eventId: "",
destination: Targeted Email Id

So It will move to Destination Email Calendar. Thank you.

Santosh Khavekar
  • 597
  • 1
  • 6
  • 22