【发布时间】:2016-03-25 16:52:35
【问题描述】:
我尝试使用 Google API 从我公司的 Google Apps 中获取日历资源列表 (https://support.google.com/a/answer/60766?hl=en)。我尝试使用 OAuth 2.0 Playground 页面 (https://developers.google.com/oauthplayground) 来使用它。我做什么:
1. 我使用我公司的管理员帐户选择范围并授权 API 并使用此范围https://apps-apis.google.com/a/feeds/calendar/resource/
2. 我交换了令牌的授权码
3.我放了一个请求的网址:https://apps-apis.google.com/a/feeds/calendar/resource/2.0/my-company-domain-url/
4. 我发送请求,我得到错误:
HTTP/1.1 403 Forbidden
Alternate-protocol: 443:quic,p=1
Content-length: 207
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Transfer-encoding: chunked
Expires: Fri, 18 Dec 2015 22:09:43 GMT
Server: GSE
-content-encoding: gzip
Cache-control: private, max-age=0
Date: Fri, 18 Dec 2015 22:09:43 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Content-type: text/html; charset=UTF-8
<HTML>
<HEAD>
<TITLE>You are not authorized to access this API.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>You are not authorized to access this API.</H1>
<H2>Error 403</H2>
</BODY>
</HTML>
我已经在 Developers Console 中启用了这个 API。
问题:我还需要做什么才能使其工作,即能够获取日历资源列表?
【问题讨论】:
标签: google-api google-api-java-client google-admin-sdk