Sending Calendar API Batch requests returns error 400

704 views
Skip to first unread message

CC

unread,
Mar 25, 2013, 6:53:58 PM3/25/13
to google-ca...@googlegroups.com
According to the docs (https://developers.google.com/google-apps/calendar/batch) it should be possible to send a batch request by posting a multipart/mixed content type message to the API.
I have tried posting a message as described to https://www.googleapis.com/calendar/v3/calendars/batch HTTP/1.1, with Content-Type: multipart/mixed; boundary=batch_boundary but always receive an error .. Status=Bad Request, StatusCode=400, with the helpful addition ..  Your client has issued a malformed or illegal request. That’s all we know.
The body of my message has ..

--batch_boundary
Content-Type: application/http

DELETE https://www.googleapis.com/calendar/v3/calendars/ejf3hkbblivf...@group.calendar.google.com/events/k77om8mbn6g374pr5XXXXXXX

--batch_boundary
Content-Type: application/http

DELETE https://www.googleapis.com/calendar/v3/calendars/ejf3hkbblivf...@group.calendar.google.com/events/n6o81jm4f6c67gs7aoXXXXXX

--batch_boundary--


Anybody have any idea what might be wrong?
Message has been deleted

James Covington

unread,
Mar 26, 2013, 8:48:44 AM3/26/13
to google-ca...@googlegroups.com
The requests in your batch should all be GET, PUT, or POST. DELETE is not recognized as a valid HTTP REQUEST.


On Monday, March 25, 2013 6:53:58 PM UTC-4, CC wrote:
According to the docs (https://developers.google.com/google-apps/calendar/batch) it should be possible to send a batch request by posting a multipart/mixed content type message to the API.
I have tried posting a message as described to https://www.googleapis.com/calendar/v3/calendars/batch HTTP/1.1, with Content-Type: multipart/mixed; boundary=batch_boundary but always receive an error .. Status=Bad Request, StatusCode=400, with the helpful addition ..  Your client has issued a malformed or illegal request. That’s all we know.
The body of my message has ..

Constantine Chimonides

unread,
Mar 26, 2013, 8:58:18 AM3/26/13
to google-ca...@googlegroups.com
I get the same behaviour with GET unfortunately. 


--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar...@googlegroups.com.
To post to this group, send email to google-ca...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-calendar-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

James Covington

unread,
Mar 26, 2013, 9:54:36 AM3/26/13
to google-ca...@googlegroups.com
have you tried relative paths? i.e. GET /ejf3hkbblivf7sk81ieXXXXXX@group.calendar.google.com/events/k77om8mbn6g374pr5XXXXXXX

On Tuesday, March 26, 2013 8:58:18 AM UTC-4, CC wrote:
I get the same behaviour with GET unfortunately. 
On Tue, Mar 26, 2013 at 12:48 PM, James Covington <james.h....@gmail.com> wrote:
The requests in your batch should all be GET, PUT, or POST. DELETE is not recognized as a valid HTTP REQUEST.


On Monday, March 25, 2013 6:53:58 PM UTC-4, CC wrote:
According to the docs (https://developers.google.com/google-apps/calendar/batch) it should be possible to send a batch request by posting a multipart/mixed content type message to the API.
I have tried posting a message as described to https://www.googleapis.com/calendar/v3/calendars/batch HTTP/1.1, with Content-Type: multipart/mixed; boundary=batch_boundary but always receive an error .. Status=Bad Request, StatusCode=400, with the helpful addition ..  Your client has issued a malformed or illegal request. That’s all we know.
The body of my message has ..

--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar-api+unsub...@googlegroups.com.

James Covington

unread,
Mar 26, 2013, 10:22:29 AM3/26/13
to google-ca...@googlegroups.com
I reviewed the documentation links again, and it looks like your individual requests are ok. Have you successfully tested these as individual http requests vice as a batch file? The reason I ask is I wonder if it's your authorization portion (not included in your code snippet) that's not correct.


On Monday, March 25, 2013 6:53:58 PM UTC-4, CC wrote:
According to the docs (https://developers.google.com/google-apps/calendar/batch) it should be possible to send a batch request by posting a multipart/mixed content type message to the API.
I have tried posting a message as described to https://www.googleapis.com/calendar/v3/calendars/batch HTTP/1.1, with Content-Type: multipart/mixed; boundary=batch_boundary but always receive an error .. Status=Bad Request, StatusCode=400, with the helpful addition ..  Your client has issued a malformed or illegal request. That’s all we know.
The body of my message has ..

Constantine Chimonides

unread,
Mar 26, 2013, 10:35:49 AM3/26/13
to google-ca...@googlegroups.com
Yes, I've tried them individually and they work fine. The authorization part is passed in the header of the 'outer' request .. something like ..  Authorization: Bearer ya29.AHES6ZR0xjT8hI7S8nVhwnJ00Ht76VCSiizXXXXXXXX, and I think it's works fine as it is recognised and I get authorization errors only when the token has actually expired. I've tried adding the same authorization to the individual items as well, but that doesn't seem to make any difference.

James Covington

unread,
Mar 26, 2013, 11:01:19 AM3/26/13
to google-ca...@googlegroups.com
Are you providing a CONTENT-LENGTH header?

Constantine Chimonides

unread,
Mar 26, 2013, 11:11:10 AM3/26/13
to google-ca...@googlegroups.com
Yes, I've tried it with and without a content-length header with no success. I'm setting the content-length in the 'outer' request to the length of the body part of the message.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar...@googlegroups.com.

James Covington

unread,
Mar 26, 2013, 2:58:37 PM3/26/13
to google-ca...@googlegroups.com
I guess that exhausts the limits of the help I'm able to provide. Hopefully a Google developer is also reading these posts...


On Tuesday, March 26, 2013 11:11:10 AM UTC-4, CC wrote:
Yes, I've tried it with and without a content-length header with no success. I'm setting the content-length in the 'outer' request to the length of the body part of the message.
On Tue, Mar 26, 2013 at 3:01 PM, James Covington <james.h....@gmail.com> wrote:
Are you providing a CONTENT-LENGTH header?


On Tuesday, March 26, 2013 10:35:49 AM UTC-4, CC wrote:
Yes, I've tried them individually and they work fine. The authorization part is passed in the header of the 'outer' request .. something like ..  Authorization: Bearer ya29.AHES6ZR0xjT8hI7S8nVhwnJ00Ht76VCSiizXXXXXXXX, and I think it's works fine as it is recognised and I get authorization errors only when the token has actually expired. I've tried adding the same authorization to the individual items as well, but that doesn't seem to make any difference.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar-api+unsub...@googlegroups.com.

Matt Kaufman

unread,
Aug 2, 2013, 12:36:15 PM8/2/13
to google-ca...@googlegroups.com
I too am struggling with this.  I get the badContent response when I set my Content-Type to "multipart/mixed; boundary=batch_foobarbaz".  But when I change it to "multipart/form-data; boundary=batch_foobarbaz", I get an html response that says "Bad Request", which sounds more promising, but is still a 400.

Has anyone been able to successfully do this?


On Tuesday, March 26, 2013 8:11:10 AM UTC-7, CC wrote:
Yes, I've tried it with and without a content-length header with no success. I'm setting the content-length in the 'outer' request to the length of the body part of the message.
On Tue, Mar 26, 2013 at 3:01 PM, James Covington <james.h....@gmail.com> wrote:
Are you providing a CONTENT-LENGTH header?


On Tuesday, March 26, 2013 10:35:49 AM UTC-4, CC wrote:
Yes, I've tried them individually and they work fine. The authorization part is passed in the header of the 'outer' request .. something like ..  Authorization: Bearer ya29.AHES6ZR0xjT8hI7S8nVhwnJ00Ht76VCSiizXXXXXXXX, and I think it's works fine as it is recognised and I get authorization errors only when the token has actually expired. I've tried adding the same authorization to the individual items as well, but that doesn't seem to make any difference.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar-api+unsub...@googlegroups.com.

Peter Künemann

unread,
Jan 26, 2015, 11:40:50 AM1/26/15
to google-ca...@googlegroups.com
One question: how do I delete Events when DELETE is not a valid HTTP Request?


Am Dienstag, 26. März 2013 13:58:18 UTC+1 schrieb CC:
I get the same behaviour with GET unfortunately. 
On Tue, Mar 26, 2013 at 12:48 PM, James Covington <james.h....@gmail.com> wrote:
The requests in your batch should all be GET, PUT, or POST. DELETE is not recognized as a valid HTTP REQUEST.


On Monday, March 25, 2013 6:53:58 PM UTC-4, CC wrote:
According to the docs (https://developers.google.com/google-apps/calendar/batch) it should be possible to send a batch request by posting a multipart/mixed content type message to the API.
I have tried posting a message as described to https://www.googleapis.com/calendar/v3/calendars/batch HTTP/1.1, with Content-Type: multipart/mixed; boundary=batch_boundary but always receive an error .. Status=Bad Request, StatusCode=400, with the helpful addition ..  Your client has issued a malformed or illegal request. That’s all we know.
The body of my message has ..

--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/v0OTgYV_DhE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-calendar-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages