Open sanneterpstra opened 8 years ago
It's the response from the server so it's not a problem with the package, so you shouldn't ask it here. Have you tried inserting only the summary
?
Thanks for the quick response!
When I only insert the summary it still responds with a parseError. I tried using your suggested code in this issue:
var result = HTTPJWT.post('https://www.googleapis.com/calendar/v3/calendars/{YOUR_CALENDAR_ID}/events', {
params: {
'summary': 'Google I/O 2015'
}
});
But then I get the following error:
Error: failed [400] { "error": { "errors": [ { "domain": "global", "reason": "parseError", "message": "This API does not support parsing form-encoded input." } ], "code": 400, "message": "This API does not support parsing form-encoded input." } }
I'm not sure what to do.. Could you please help me with this?
Have you tried without setting headers? It's hard to tell what is the reason.
Yes I also tried without headers but then the API says it doesn't support form-encoded input
. When setting the headers to JSON, the form-encoded parse error goes away but then it just gives a parse error
. And when using a JSON header without any params it says it needs an end date.
So it seems that the API only accepts JSON formatted data but when I give it JSON data by putting it in the params
it returns a parse error without any further information.
You know, it's hard to predict what is the source of the error. I've created this package to access Google Endpoint API. It's based on the node.js package. It worked well in my project. I haven't tested it with Calendar API. However as you said it work on getting values but you can't insert. What I would suggest is checking in Google Chrome Developer Tools what requests are send when using this package and what requests are send using the Google Sandbox. Thanks to that you may compare the data and see a difference.
invalidRequest (HTTP status 400): Your request was not a valid request.
@shamoon1992 and? :)
Hi have you resolved this? I’m having the same issue.
same fucking error!!!!!
I'm also getting this error response from Google when trying to create a calendar event.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error"
}
],
"code": 400,
"message": "Parse Error"
}
}
I'm only setting a start.dateTime
and end.dateTime
and nothing else (though I've also tried setting a summary and description, but get the same thing).
POST https://www.googleapis.com/calendar/v3/calendars/primary/events?access_token=my_valid_access_token
Accept: application/json
{"start":{"dateTime":"2018-07-02T13:41:55Z"},"end":{"dateTime":"2018-07-02T13:56:55Z"}}
EDIT
I found the solution. It was that I was simply missing the Content-Type
header. I guess it would've been nice if it told me that. Either way, yay!
Even after adding contentType("application/json\r\n")
still seeing the same error. Tried hitting it on google API explorer works like charm but with rest assured it just gives the same error again. Has anyone found any other solution to the issue ?
I'm also getting this error response from Google when trying to create a calendar event.
{ "error": { "errors": [ { "domain": "global", "reason": "parseError", "message": "Parse Error" } ], "code": 400, "message": "Parse Error" } }
I'm only setting a
start.dateTime
andend.dateTime
and nothing else (though I've also tried setting a summary and description, but get the same thing).POST https://www.googleapis.com/calendar/v3/calendars/primary/events?access_token=my_valid_access_token Accept: application/json {"start":{"dateTime":"2018-07-02T13:41:55Z"},"end":{"dateTime":"2018-07-02T13:56:55Z"}}
EDIT
I found the solution. It was that I was simply missing the
Content-Type
header. I guess it would've been nice if it told me that. Either way, yay!
Thanks! that was. I had " ContentType
I'm trying to integrate Google Calendar in my meteor app. Reading events goes fine but when I try to create an event by using the post request I'm getting a Parse Error.
This is the code for the request (using Google's example code):
However the response I'm getting back is an Parse Error with no additional information.
Error: failed [400] { "error": { "errors": [ { "domain": "global", "reason": "parseError", "message": "Parse Error" } ], "code": 400, "message": "Parse Error" } }