Google app engine 400错误请求在Google日历中插入事件

Google app engine 400错误请求在Google日历中插入事件,google-app-engine,google-calendar-api,Google App Engine,Google Calendar Api,我正在使用Google Calendar API,我试图向API发送一个插入事件的请求,但我得到了一个错误 这是我发出的请求: POST https://www.googleapis.com/calendar/v3/calendars/riteshmehandiratta%40gmail.com/events?key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.AHES6ZQwHy_3OY

我正在使用Google Calendar API,我试图向API发送一个插入事件的请求,但我得到了一个错误

这是我发出的请求:

POST https://www.googleapis.com/calendar/v3/calendars/riteshmehandiratta%40gmail.com/events?key={YOUR_API_KEY}

Content-Type:  application/json
Authorization:  Bearer ya29.AHES6ZQwHy_3OYLmXtZpSa5PIwnBO3hqLWolMXpTYiFOEtjlEmbxNrYn
X-JavaScript-User-Agent:  Google APIs Explorer

{

 "end": {
  "date": "2/14/2007"
 },
 "start": {
  "date": "2/14/2007"
 },
 "kind": "calendar#event",
 "summary": "Hello World"
}
我得到的答复是:

400 Bad Request

- Hide headers -

cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  122
content-type:  application/json; charset=UTF-8
date:  Sat, 23 Mar 2013 17:36:22 GMT
expires:  Sat, 23 Mar 2013 17:36:22 GMT
server:  GSE

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}

我无法找出我收到错误请求的原因。

从我可以看出您的日期格式错误,API文档表明:

 The date, in the format "yyyy-mm-dd", if this is an all-day event. 
您可能希望使用此页面底部的“试用”表单,首先确保您的请求有效:

祝你好运

这就是我所做的(PHP):

上面的脚本片段适合我

Rohan的格式设置是正确的

//Passed in a GET variable name of 'date'
//Tells parser the current format
$dt = DateTime::createFromFormat("d/m/Y", $_GET['date']);

//Adding the event start date, modifying the format to suit googles encoding
$start->setDate($df->format("Y-m-d"));