0

I'm programmatically reading user's private post from Google+ Domains API using the Java class com.google.api.services.plusDomains.PlusDomains.Activities.List as documented here, and I'm using the domain authorized service account and PCKS12 file so I'm pretty sure that I have proper credential configured for the API call.

For most of accounts, when I call PlusDomains.Activities.List, I do receive a json object containing a list of domain private posts of the given user, represented by class com.google.api.services.plusDomains.model.Activity. However, for a specific user, the same call doesn't return any activity, even there're activities to be returned.

We contacted the Google support team and they said it might be a client library problem and asked us to open an issue here. I'd be really glad if anyone could help us on this.

Here is my code snippet:

PlusDomains plusDomains = new PlusDomains.Builder(httpTransport,  jsonFactory, credential).setApplicationName(appName).setRootUrl("https://www.googleapis.com/").setHttpRequestInitializer(credential).build();
PlusDomains.Activities.List listActivities = plusDomains.activities().list("me", "user");
listActivities.setMaxResults(50l);
com.google.api.services.plusDomains.model.ActivityFeed activityFeed = listActivities.execute();
List<com.google.api.services.plusDomains.model.Activity> activities = activityFeed.getItems();

The client library version in my POM.xml is:

<dependency>
   <groupId>com.google.apis</groupId>
   <artifactId>google-api-services-plusDomains</artifactId>
   <version>v1-rev291-1.22.0</version>
</dependency>
Luth
  • 31
  • 2

1 Answers1

0

We just solved the issue. This problem was caused because the user who we're trying to get activities from by using G+ Domain API has disabled the option "Show your Google+ communities posts on the Posts tab of your Google+ profile." in G+ profile settings.

With this option disabled, G+ Domain API cannot read any user activities related to a Google+ community.

Luth
  • 31
  • 2