0

I'm trying to implement a simple POST call in meteor.js to the Google Calendar API, and I'm stuck. My request looks like this:

var id = Meteor.http.post("https://www.googleapis.com/calendar/v3/calendars/", {
    'headers' : { 
      'Authorization': auth, // auth = "Bearer " + Meteor.user().services.google.accessToken
      'Content-Type': 'application/json' 
    },
    'parameters': {},
    'body' : { 
      'title': "Calendar Title",
    }
  });

and I get the following error:

Error: failed [400] {
    "error": {
        "errors": [{
            "domain": "global",
            "reason": "required",
            "message": "Missing title."
        }],
    "code": 400,
    "message": "Missing title."
    }
}

Any ideas?

rohan
  • 53
  • 1
  • 3

1 Answers1

0

Solved it. This is dumb.

Take out parameters, and make "body" "data" instead and it works.

rohan
  • 53
  • 1
  • 3
  • Hi Rohan, do you have any suggestions for my question here?: http://stackoverflow.com/questions/32144042/making-google-calendar-api-calls-from-google-apps-script-using-oauth2-and-domain Thank you. – Employee Aug 21 '15 at 18:18