Unable to get Domain Restricted Google+ Community Name

199 views Asked by At

I'm trying to get all the activities done by my Google apps domain users. But If someone made a post in myDomain Restricted Community, API is not return the community name. Instead of getting the actual community name, its returning "domain".

If someone made a post in Private(invite Only)/Public Community, API shows the correct name.

This is the URL being fetched to get the user activites.

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

Result for Domain Restricted Community :

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

Result for All other Community :

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

API Scope & Code:

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)

I'm using this GitHub repository: https://github.com/vircheck/socialplus-prototype

There the files used to fetch the activities:

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

For Domain Restricted Communities, it throws this exception

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
0

There are 0 answers