2017-01-17 65 views
1

我試圖測試在Google API Explorer - calendar.event.insert奇怪的錯誤403:有與會者

指定「主要」作爲添加事件到使用谷歌API的瀏覽器頁面我的谷歌日曆添加事件時,「日曆使用限制超標」 calendarId,並啓用'OAuth 2.0'授權。

請求體領域如下:

{ 
    "summary": "Another test", 
    "start": { 
    "dateTime": "2017-01-17T11:30:00+02:00" 
    }, 
    "end": { 
    "dateTime": "2017-01-17T12:00:00+02:00" 
    }, 
    "attendees": [ 
    { 
     "email": "[email protected]_domain.com" 
    } 
    ] 
} 

但點擊「授權和執行」按鈕時,我得到以下錯誤:

403 

- Show headers - 

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "usageLimits", 
    "reason": "quotaExceeded", 
    "message": "Calendar usage limits exceeded." 
    } 
    ], 
    "code": 403, 
    "message": "Calendar usage limits exceeded." 
} 
} 

如果我發送相同的請求但沒有'與會者'部分,它每次都有效。

我在這裏做錯了什麼?

+0

我發現這篇文章,可能把一些光對這個錯誤: https://code.google.com/a/google。 com/p/apps-api-issues/issues/detail?id = 3363 –

+1

沒有關係,這是使用服務帳戶你不使用服務帳戶。 – DaImTo

回答

1

由於大部分配額都是基於項目和其相同的項目,因此API Explorer會將您轉儲到與其他人使用api explorer相同的配額。

您可能正在獲取它,因爲還有其他人在同一時間測試您正在測試的內容。對於你可以測試的東西也有限制。我懷疑它不是完全有用的。

另請檢查Calendar usage limits您有多少測試?

Calendar usage limits exceeded. This is the result of an API call. (Don't mix this up with the message "Daily quota exceeded," which points to insufficient API quota.)

Creating too many events

If a user has created more than 10,000 events in his or her calendar within a short period of time, that user might lose calendar edit access.

解決方案:而不是使用API​​的探險家從自己的應用程序發送的請求。

我發送的工作正常。

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

{ 
"end": { 
    "dateTime": "2017-01-17T11:30:00+02:00" 
}, 
"start": { 
    "dateTime": "2017-01-17T11:30:00+02:00" 
}, 
"attendees": [ 
    { 
    "email": "[email protected]" 
    } 
] 
} 

響應:

- Show headers - 

{ 


"kind": "calendar#event", 
"etag": "\"2969293763864000\"", 
"id": "did1s0f76g79s1ht5aplhieoik", 
"status": "confirmed", 
"htmlLink": "https://www.google.com/calendar/event?eid=ZGlkMXMwZjc2Zzc5czFodDVhcGxoaWVvaWsgbGF1cmx5NzFAbQa", 
"created": "2017-01-17T09:54:41.000Z", 
"updated": "2017-01-17T09:54:41.932Z", 
"creator": { 
    "email": "[email protected]", 
    "displayName": "Linda Lawton", 
    "self": true 
}, 
"organizer": { 
    "email": "[email protected]", 
    "displayName": "Linda Lawton", 
    "self": true 
}, 
"start": { 
    "dateTime": "2017-01-17T10:30:00+01:00" 
}, 
"end": { 
    "dateTime": "2017-01-17T10:30:00+01:00" 
}, 
"iCalUID": "[email protected]", 
"sequence": 0, 
"attendees": [ 
    { 
    "email": "[email protected]", 
    "responseStatus": "needsAction" 
    } 
], 
"reminders": { 
    "useDefault": true 
} 
} 
+0

我使用資源管理器的原因是因爲我的應用程序得到相同的錯誤。你對配額錯了,因爲我使用了不同的授權(配額是每個用戶)。 另外,當我刪除'參加者'部分時 - 它可以多次正常工作。 –

+0

只是電子郵件?你有不同的電子郵件地址測試嗎? – DaImTo

+0

當然。所有電子郵件都失敗。請參閱我對該問題的評論 - Google API中可能存在一個錯誤... –