Google日历:freeBusy给出错误"notFound"有一个帐户但没有另一个 [英] Google Calendar: freeBusy giving error "notFound" with one account but not another

查看:63
本文介绍了Google日历:freeBusy给出错误"notFound"有一个帐户但没有另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我使用的是企业帐户的google应用,我有2个帐户test1@mycompany.com和test2@mycompany.com

To start off I'm using a google apps for business account and I have 2 accounts test1@mycompany.com and test2@mycompany.com

此后,我在API控制台中注册了一个Api电子邮件到test1@mycompany.com,我将其表示为##### @ developer.gserviceaccount.com

After that I have an Api E-Mail that is registered in the API console to test1@mycompany.com which I'll represent as #####@developer.gserviceaccount.com

查询很简单,我只是有一个timeMin&最大时间我使用Java客户端API将每个ID为2的项目发送给我们

The query is a simple, I simply have a timeMin & timeMax & 2 items each with id's i send this using the Java client API

使用GoogleAuthorizationCodeFlow并使用test1@mycompany.com的第一个查询

First query with GoogleAuthorizationCodeFlow and using test1@mycompany.com

{
 "kind": "calendar#freeBusy",
 "timeMin": "2013-03-26T22:50:16.501Z",
 "timeMax": "2013-03-26T22:50:22.501Z",
 "calendars": {
  "test1@mycompany.com": {
   "busy": []
  },
  "test2@mycompany.com": {
   "busy": []
  }
 }
}

这是我使用第二种授权方法所获得的(获取错误"notFound")

This is what I get for the second authorization method using (Getting the error "notFound")

GoogleCredential.Builder()
.setServiceAccountId("#####@developer.gserviceaccount.com")
.setServiceAccountPrivateKeyFromP12File("key.p12").etc().etc()

{
 "kind": "calendar#freeBusy",
 "timeMin": "2013-03-26T22:19:14.770Z",
 "timeMax": "2013-03-26T22:19:20.770Z",
 "calendars": {
  "test1@mycompany.com": {
   "busy": []
  },
  "test2@mycompany.com": {
   "errors": [
    {
     "domain": "global",
     "reason": "notFound"
    }
   ],
   "busy": []
  }
 }
}

即使test1@mycompany.com可以访问test2@mycompany.com #####@developer.gserviceaccount.com也不能,但为什么这两个帐户实际上是同一个帐户,不是吗?无论如何,#####@developer.gserviceaccount.com属于test1@mycompany.com. Test2@mycompany.com设置为共享日历(如第一个查询所示),我不知道为什么开发者帐户无法访问该业务.

Even though test1@mycompany.com can gain access to test2@mycompany.com #####@developer.gserviceaccount.com cannot, why is this they are both really the same account are they not? #####@developer.gserviceaccount.com belongs to test1@mycompany.com anyways. Test2@mycompany.com is set to share the calendar(As evident in the first query) and I don't know why the developer account doesn't have access to that business.

推荐答案

对于没有更多详细信息,我深表歉意,但是最终解决的方法是让Apps for Business帐户的所有者添加开发者电子邮件地址(## ###@developer.gserviceaccount.com)作为代表,现在我可以在公司帐户上获得任何人的freeBusy时间.将#####@developer.gserviceaccount.com作为用户添加到日历本身的另一个答案也可以.(尽管我必须为每个用户执行此操作)

I apologize for not having more specifics, but how this was eventually resolved was by having the owner of the Apps for Business account add the developer email address ( #####@developer.gserviceaccount.com) as a delegate, and now I can get freeBusy times of anyone on the business account. The other answer of adding the #####@developer.gserviceaccount.com as a user on the calendar itself also worked.(Though I would have had to do this for every user)

这篇关于Google日历:freeBusy给出错误"notFound"有一个帐户但没有另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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