Error 404 when update google calendar event in meteor


#1

I’m using the below code to update google calendar event in my meteor application (in cloud9), but it returns 404,

Meteor.http.post("https://www.googleapis.com/calendar/v3/calendars/primary/events/eventid123", {
'headers' : { 
  'Authorization': "Bearer " + Meteor.user().services.google.accessToken,
  'Content-Type': 'application/json' 
},
'data': {
  "summary": "Meteor calendar event update",
  "description": "Event is created with meteor",
  "location": "Test Location",
  "start": {
    "dateTime": moment(NewStartDate).format("YYYY-MM-DDTHH:mm:ssZ"),
  },
  "end": {
    "dateTime": moment(NewEndDate).format("YYYY-MM-DDTHH:mm:ssZ"),
  },
}

});
Whereas, my insert calendar event was successful using below code,

Meteor.http.post("https://www.googleapis.com/calendar/v3/calendars/primary/events", {
'headers' : { 
  'Authorization': "Bearer " + Meteor.user().services.google.accessToken,
  'Content-Type': 'application/json' 
},
'data': {
  "id": "eventid123",
  "summary": "Meteor event insert",
  "description": "Event is inserted using meteor",
  "location": "test location",
  "start": {
    "dateTime": moment(startDate).format("YYYY-MM-DDTHH:mm:ssZ"),
  },
  "end": {
    "dateTime": moment(endDate).format("YYYY-MM-DDTHH:mm:ssZ"),
  },
}

});
Please guide me to fix this issue.

Note: I have verified the eventId via google calendar debug mode, it is same as “eventid123”

http://stackoverflow.com/questions/33851201/error-404-when-update-google-calendar-event-in-meteor