1

我正在尝试让我的 Google Apps 域用户完成所有活动。但是如果有人在我的Domain Restricted Community, API is not return the community name. 它没有得到实际的社区名称,而是返回"domain".

如果有人在私人(仅限邀请)/公共社区发帖,API 会显示正确的名称。

这是获取用户活动的 URL。

https://www.googleapis.com/plus/v1domains/activities/peopleID/people/sharedto?fields=totalItems&alt=json

域受限社区的结果:

'access': {'items': [{'type': 'domain'}], 'kind': 'plus#acl', 'description': 'Domain', 'domainRestricted': True}

所有其他社区的结果:

'access': {'kind': 'plus#acl', 'description': 'Test Community (Discussion)', 'domainRestricted': True}

API 范围和代码:

credentials = SignedJwtAssertionCredentials(API_ACCESS_DATA[CURRENT_DOMAIN]["SERVICE_ACCOUNT_EMAIL"], key, scope=[
            "https://www.googleapis.com/auth/plus.circles.read",
            "https://www.googleapis.com/auth/plus.circles.write",
            "https://www.googleapis.com/auth/plus.profiles.read",
            "https://www.googleapis.com/auth/plus.stream.read",
            "https://www.googleapis.com/auth/plus.stream.write",
            "https://www.googleapis.com/auth/plus.me"
        ], sub=user_email)
http = credentials.authorize(http)
service = build("plus", "v1domains", http=http)

我正在使用这个 GitHub 存储库:https ://github.com/vircheck/socialplus-prototype

那里有用于获取活动的文件:

https://github.com/vircheck/socialplus-prototype/blob/master/DJANGO_GAE/socialplus/routines/sync_activities.py

https://github.com/vircheck/socialplus-prototype/blob/master/DJANGO_GAE/socialplus/api.py

https://github.com/vircheck/socialplus-prototype/blob/master/DJANGO_GAE/socialplus/data/activities.py

对于域受限社区,它会抛出此异常

socialplus\data\activities.py", line 122, in _get_activity_access

    raise Exception("ACL cannot be parsed for activity " + a["id"])

Exception: ACL cannot be parsed for activity zsdsdf32332132dlas3df03lvd3
4

0 回答 0