开发者控制台上的Google Calendar Api错误请求400事件 [英] Google Calendar Api bad request 400 event over developer console

查看:117
本文介绍了开发者控制台上的Google Calendar Api错误请求400事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了项目,并使用 https://code.google.com/apis/console注册了项目 (我选择了其他"应用程序类型). 然后我得到了已安装应用程序的客户端ID".

I've created project and registered it using https://code.google.com/apis/console (I've choosen "other" application type). Then I got "Client ID" for installed applications.

然后我去控制台创建事件,并使用oauth 2授权. https://developers.google.com/google-apps/calendar /v3/reference/events/insert 一切正常.

Then I went to console and created event, and authorised using oauth 2. https://developers.google.com/google-apps/calendar/v3/reference/events/insert Everything worked fine.

    POST https://www.googleapis.com/calendar/v3/calendars/primary/events?key={YOUR_API_KEY}

Content-Type:  application/json
Authorization:  xxx
X-JavaScript-User-Agent:  Google APIs Explorer

{
 "end": {
  "dateTime": "2013-1-16T10:00:00.000-07:00"
 },
 "start": {
  "dateTime": "2013-1-16T10:00:00.000-07:00"
 }
}

响应

200 OK

- Show headers -

{

 "kind": "calendar#event",
 "etag": "\"WANTVF5ixxZ04U_VtQ0AZ3MbAlM/Z2NhbDAwMDAxMzY1NjU0MzAwNTk1MDAw\"",
 "id": "2nsuis19mkp2q0uef54tl5nk68",
 "status": "confirmed",
 "htmlLink": "https://www.google.com/calendar/event?eid=Mm5zdWlzMTlta3AycTB1ZWY1NHRsNW5rNjggaXZhbjEzMzEzM0Bt",
 "created": "2013-04-11T04:25:00.000Z",
 "updated": "2013-04-11T04:25:00.595Z",
 "creator": {
  "email": "ivan133133@gmail.com",
  "displayName": "ivan rozhcov",
  "self": true
 },
 "organizer": {
  "email": "ivan133133@gmail.com",
  "self": true
 },
 "start": {
  "dateTime": "2013-01-16T21:00:00+04:00"
 },
 "end": {
  "dateTime": "2013-01-16T21:00:00+04:00"
 },
 "iCalUID": "2nsuis19mkp2q0uef54tl5nk68@google.com",
 "sequence": 0,
 "reminders": {
  "useDefault": true
 }
}

然后,我复制了ID并更新了此事件. https://developers.google.com/google-apps/calendar /v3/reference/events/update 更新 我第一次得到200条回复.

Then I copied id and updated this event. https://developers.google.com/google-apps/calendar/v3/reference/events/update update First time I got 200 response.

PUT https://www.googleapis.com/calendar/v3/calendars/primary/events/2nsuis19mkp2q0uef54tl5nk68?key={YOUR_API_KEY}

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

{
 "end": {
  "dateTime": "2013-1-16T10:00:00.000-07:00"
 },
 "start": {
  "dateTime": "2013-1-16T10:00:00.000-07:00"
 }
}

但是当我再次尝试此操作时,总是出现400错误,错误文本写在下面.

But when I tried this again, I always got 400 error, error text is written below.

https://developers.google.com/google- apps/calendar/v3/reference/events/update 更新

400 Bad Request

cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  123
content-type:  application/json; charset=UTF-8
date:  Wed, 10 Apr 2013 12:49:29 GMT
expires:  Wed, 10 Apr 2013 12:49:29 GMT
server:  GSE

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}

任何人都可以解释一下,如果那是google.api错误,或者我在某个地方弄错了?

Can anyone explain, if that's google.api bug, or maybe I'm mistaken somwhere?

我已经尝试过从不同的帐户和PC(通过Google API Explorer和python库获得相同的结果)

I've tryed it from differret account and PC (throught Google APIs Explorer and python library with same result)

今天,我试图重现该错误.但是everring现在可以正常工作了. 我在Google代码中创建了一个问题 http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3371&thanks=3371&ts=1365599378 仍然没有答案.

Today I've tried to reproduce that bug. But everring works fine now. I've created an issue in google code http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3371&thanks=3371&ts=1365599378 Still without answer.

我认为这是temporaru错误.

I think it's was temporaru bug.

推荐答案

400几乎总是意味着您的身份验证URL中存在一个简单的语法错误.最常见的原因是您无法通过网址转义范围或重定向URL,或者多次使用网址转义了URL.

400 almost always means a simple syntax error in your auth URL. The most common cause is that you’ve either failed to URL-escape your scope or redirect, or alternatively URL-escaped it more than once.

这篇关于开发者控制台上的Google Calendar Api错误请求400事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆