I am facing with an issue using the Apps provisioning APIs for Groups. I am 
using the following code to check if an email([email protected]) exists in a 
group([email protected])

            String scope = 
"https://apps-apis.google.com/a/feeds/group/#readonly";//No I18N
            GoogleOAuthParameters oauthParameters = new 
GoogleOAuthParameters();
            oauthParameters.setOAuthConsumerKey(consumerKey);
            oauthParameters.setOAuthConsumerSecret(consumerSecret);
            AppsGroupsService  grp = new AppsGroupsService("","");
            OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();
            oauthParameters.setScope(scope);
            grp.setOAuthCredentials(oauthParameters, signer);
            boolean isMember=grp.isMember("[email protected]", 
"[email protected]");//grp.isMember(groupId, userEmail);
 

This code works fine and gives me false if he is not a member and true when 
i added "[email protected]" in the group with role as (Owner/Member). Now the 
problem comes when i remove this user[added as Owner earlier] from the group 
and when i check if he is a member i always get true from now on(even-though 
the user is removed from the group).

I even tried in an alternative way as below which gives the feed for the 
user([email protected]) in this group([email protected]) and checking if the 
feed has any properties which gives the same result.

URL retrieveUrl= new 
URL("https://apps-apis.google.com/a/feeds/group/2.0/example.com/
[email protected]/member/[email protected]");
try{
         GenericEntry feed = grp.getEntry(retrieveUrl, 
GenericEntry.class);//retrieves the feed for the user in this group
          if(feed.getAllProperties().size()>0){//checking if the feed has 
any properties
              isMember=true;
          }
}catch(AppsForYourDomainException e){
            e.printStackTrace();
}

 Please look into problem i am facing with and provide a solution on this.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Apps Domain Information and Management APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to