3

Heres the deal,

On googles developer website they have at the bottom of each api function description a tool to try out the api, specifically I am using the calendar api (where it says " Use the APIs Explorer bellow to ...): https://developers.google.com/google-apps/calendar/v3/reference/events/get

This call returns an event when you enter a calendar ID and an eventID. After switching the little OAuth2.0 switch on and entering my calandarID and an event ID of mine it returns a nice 200 ok response with the event details.

Heres the problem: I go over to the move function in the calendar api: https://developers.google.com/google-apps/calendar/v3/reference/events/move

And fill in once again my calendar ID containing the event I want to move, the event ID (same as before) and the destination calendar ID (my other gmail account). but on executing this I get a red box with "the resource was not found" and the response is a 404.

Weird thing is I have been able to do this via the actual google calendar website by going into edit event -> drop down: calendar -> change owner, I get a box to fill in new calendar ID and it successfully went to my other gmail. Both calendars where not public when I tried via the GUI and are not public now when using the API. Preferably I want them to stay that way.

Any ideas why the api for moving a calendar event is not working for me?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jimmie
  • 397
  • 2
  • 5
  • 20
  • To move an event using events.move, you should have write access to both the calendars. I tried to move to different gmail account but it gave 404 error. But when I tried with moving to secondary calendar, it worked for me. Does your authorized account has write access to destination calendar? https://developers.google.com/google-apps/calendar/concepts – SGC Aug 13 '15 at 15:20
  • 1
    Ahhh I see! I must read up more on documentation before rushing to the functions. My first account does not have write access to the destination accounts calendar at the moment. I thought it would be like the GUI version where it sends an invitation to the destination asking if they want to take over but I guess its direct. Thank you for the help! – Jimmie Aug 14 '15 at 01:38
  • @Jimmie If you know the answer to my question below, I'd really appreciate it! https://stackoverflow.com/questions/31959576/google-calander-api-move-event#comment79814905_32014737 – Ryan Sep 26 '17 at 14:16

2 Answers2

1

To move an event using events.move, you should have write access to both the calendars. I tried to move to different gmail account but it gave 404 error. But when I tried with moving to secondary calendar, it worked for me. developers.google.com/google-apps/calendar/concepts

SGC
  • 1,025
  • 1
  • 6
  • 6
  • ya I have also getting same problem eventhough I have write access to both calendars,so I am getting { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } } – Santosh Khavekar Feb 18 '16 at 13:08
  • *Who* should have write access to both calendars? Currently, when I browse the Google Calendar website for each of my calendars and visit Share This Calendar, I see the email address of my service account listed with credentials to "Make changes to events". That's on both the origin calendar and the destination calendar. I'm stumped about why I'm still getting a 404 error. – Ryan Sep 26 '17 at 14:16
1

I was getting a 404 error, and I assumed it was a credentials problem since that's what other people online wrote about.

Currently, when I browse the Google Calendar website for each of my calendars and visit Share This Calendar, I see the email address of my service account listed with credentials to "Make changes to events". That's on both the origin calendar and the destination calendar.

So I couldn't figure out how to set up my credentials differently.

It turned out not to be a problem with credentials at all.

I had been using the "eid" from the URL of the Google Calendar event webpage and assumed it was the Event ID. It's not.

When I use a valid Event ID, the "move" command worked as documented here.

Ryan
  • 22,332
  • 31
  • 176
  • 357