Group Management

140 views
Skip to first unread message

Alexandre Jacquet

unread,
Jun 29, 2011, 7:12:32 PM6/29/11
to Google Apps APIS
Hello Guys,

Im have an strange issue regarding a group management. I don't know if is API issue or Google's issue. Because i have the same output in both.

I need to find in a large domain, all groups that an user that does not belongs to this domain is Owner. I had to retrieve all the groups then check if the user was owner in each one. Ok no worries, i have exported this in csv so i can manipulate faster.

The second step were to delete this owner from all the groups and the another user in his place, i was able to add this user in 600 groups however every other request that i do in Google Apps Dashboard or in my API returns a service exception, in the API calls I'm using 3LO oauth. 


Reading groupid: 6951...@xpto.com
InvalidValue(1801)
Reading groupid: 6951...@xpto.com
InvalidValue(1801)
Reading groupid: 69510...@xpto.com
InvalidValue(1801)
Reading groupid: 6951...@xpto.com
InvalidValue(1801)

Any idea?

                                                                                           

Alexandre Jacquet

Google Apps Deployment Specialst 
São Paulo | SP | Brasil
Tel.: 55 11 8064 6882




Michael Manoochehri

unread,
Jun 29, 2011, 7:30:17 PM6/29/11
to google-app...@googlegroups.com
Hi Alexandre,

Can you tell me what the exception was (was it a 503 service unavailable, or a 500 unknown exception?)... 

Also, how are you making these calls - are you adding a new groups owner, and then removing the previous owner, or something else?

Michael

Alexandre Jacquet

unread,
Jun 29, 2011, 7:48:38 PM6/29/11
to google-app...@googlegroups.com
Hello Michael,

Thank you for the fast reply.

Im not sure which one is it, the response from the XML is 1801 Invalid Value, however it worked for 500 groups.

Is raising AppsForYourDomainException.

Yes, exactly i'm trying to add the new user than remove the previous, however i have tried only or only adding without success.



                                                                                           

Alexandre Jacquet

Google Apps Deployment Specialst 
São Paulo | SP | Brasil
Tel.: 55 11 8064 6882






--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/C38BCgInG6kJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Alexandre Jacquet

unread,
Jun 29, 2011, 7:51:51 PM6/29/11
to google-app...@googlegroups.com
Using GAM i have 400

    raise gdata.apps.service.AppsForYourDomainException(e.args[0])
gdata.apps.service.AppsForYourDomainException: {'status': 400, 'body': '<?xml version="1.0" encoding="UTF-8"?>\r\n<AppsForYourDomainErrors>\r\n  <error errorCode="1801" invalidInput="" reason="InvalidValue" />\r\n</AppsForYourDomainErrors>\r\n\r\n', 'reason': 'Bad Request'}

However the group does exists.

Alexandre Jacquet

unread,
Jun 29, 2011, 7:58:00 PM6/29/11
to google-app...@googlegroups.com
I have changed the order i am able to delete the old user, however not able to create, even as only a member.


My methods.

public GenericEntry addOwnerToGroup(String groupId, String userEmail) throws AppsForYourDomainException, MalformedURLException, IOException,
ServiceException {
GenericEntry owner = new GenericEntry();
owner.addProperty("email", userEmail);
addMemberToGroup(groupId, userEmail);
logger.trace("Adding Owner: " + userEmail + " to groupId: " + groupId);
return service.insert(new URL(APPS_FEEDS_URL_BASE + "group/" + SERVICE_VERSION + "/" + domain + "/" + groupId + "/owner"), owner);
}

public GenericEntry addMemberToGroup(String groupId, String userEmail) throws AppsForYourDomainException, MalformedURLException, IOException,
ServiceException {
GenericEntry member = new GenericEntry();
member.addProperty("memberId", userEmail);
logger.trace("Adding member: " + userEmail + " in groupId: " + groupId);
return service.insert(new URL(APPS_FEEDS_URL_BASE + "group/" + SERVICE_VERSION + "/" + domain + "/" + groupId + "/member"), member);
}

Claudio Cherubino

unread,
Jun 30, 2011, 5:33:19 AM6/30/11
to google-app...@googlegroups.com
Alexandre,

Can you try performing the same request with curl?
If it still doesn't work, please show us the request body and the url you are posting to.

Claudio

Alexandre Jacquet

unread,
Jun 30, 2011, 5:39:06 AM6/30/11
to google-app...@googlegroups.com

Actually claudio i dont know how to use curl if you could explain how do i make the request

Sorry

>> Alexandre Jacquet
>>
>> Google Apps Deployment Specialst
>> São Paulo | SP | Brasil
>> Tel.: 55 11 8064 6882
>>
>>
>>
>>
>>
>> On Wed, Jun 29, 2011 at 8:51 PM, Alexandre Jacquet <
>> aleja...@ajsolutions.me> wrote:
>>
>>> Using GAM i have 400
>>>
>>> raise gdata.apps.service.AppsForYourDomainException(e.args[0])
>>> gdata.apps.service.AppsForYourDomainException: {'status': *400*, 'body':

>>> '<?xml version="1.0" encoding="UTF-8"?>\r\n<AppsForYourDomainErrors>\r\n
>>> <error errorCode="*1801*" invalidInput="" reason="InvalidValue"

>>> />\r\n</AppsForYourDomainErrors>\r\n\r\n', 'reason': 'Bad Request'}
>>>
>>> However the group does exists.
>>>
>>>
>>>
>>> Alexandre Jacquet
>>>
>>> Google Apps Deployment Specialst
>>> São Paulo | SP | Brasil
>>> Tel.: 55 11 8064 6882
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Jun 29, 2011 at 8:48 PM, Alexandre Jacquet <
>>> aleja...@ajsolutions.me> wrote:
>>>
>>>> Hello Michael,
>>>>
>>>> Thank you for the fast reply.
>>>>
>>>> Im not sure which one is it, the response from the XML is 1801 Invalid
>>>> Value, however it worked for 500 groups.
>>>>
>>>> Is raising AppsForYourDomainException.
>>>>
>>>> Yes, exactly i'm trying to add the new user than remove the previous,
>>>> however i have tried only or only adding without success.
>>>>
>>>>
>>>>
>>>>
>>>>

Claudio Cherubino

unread,
Jun 30, 2011, 6:44:48 AM6/30/11
to google-app...@googlegroups.com
Download curl from http://curl.haxx.se/ then run the following command to perform ClientLogin (of course, put your credentials):


curl https://www.google.com/accounts/ClientLogin --request POST -d Email=ad...@domain.com -d Passwd=mypassword -d accountType=HOSTED -d service=apps


From the output of the previous command, copy the Auth token.
Then create a file named member.xml with the following content:


<?xml version="1.0" encoding="UTF-8"?>
    <apps:property name="memberId" value="susan...@example.com"/>
</atom:entry>


Run the following command to add a member to a group:


curl --data "@member.xml" --request POST --header "Content-Type: application/atom+xml" --header "Authorization: GoogleLogin auth=PUT_THE_AUTH_TOKEN_HERE" "https://apps-apis.google.com/a/feeds/group/2.0/domain.com/groupid/member"


Hope it helps
Claudio

Alexandre Jacquet

unread,
Jun 30, 2011, 8:50:23 AM6/30/11
to google-app...@googlegroups.com
Hello Claudio,

It helped alot.

As requested the cURL output.

member.xml
<?xml version="1.0" encoding="UTF-8"?>
    <apps:property name="memberId" value="myu...@mydomain.com"/>
</atom:entry>


aleee@zeroKilled:~/Desktop$ curl --data "@member.xml" --request POST --header "Content-Type: application/atom+xml" --header "Authorization: GoogleLogin auth=DQAAAPcAAAAhTBOiL9FRXGWmNOm7xUoeezpntQMWjAfZ1S_F9n38tR1qnhFE_s9biAGkYPywc9_khyhqVEsOA9-9OpSrqN6iAbO0lcAQLnrbfL89ABtTiEo6c8Nw3YsYhejmcQcvJ8nyQYGTFecCP0L6jrWIUmkuPhFSqd0lQye34lAq4Zy6ARjUSvM4ugYcbjGCx1F59gqdrvdc2kHLjPz2W8LEhcFuxrPaQyMjB0jelw1BvBoljKUnly3w3qh9-0JLOXfRSu_098XoyX0Y869K-IbZjL2-WJSA9i6Yr1LQMz0aOyjaA3390YflIDoGuYW6d7nns-XXI8FS2PtLWE7PeOrn832S" "https://apps-apis.google.com/a/feeds/group/2.0/mydomain.com/6951...@mydomain.com/member"

<?xml version="1.0" encoding="UTF-8"?>
<AppsForYourDomainErrors>
  <error errorCode="1801" invalidInput="" reason="InvalidValue" />
</AppsForYourDomainErrors>


                                                                                           

Claudio Cherubino

unread,
Jun 30, 2011, 8:53:45 AM6/30/11
to google-app...@googlegroups.com
The groupId specified in your url is incorrect, it should be 69510712 instead of 6951...@mydomain.com.

Claudio

Alexandre Jacquet

unread,
Jun 30, 2011, 9:09:45 AM6/30/11
to google-app...@googlegroups.com
Even in MDM ?

Alexandre Jacquet

unread,
Jun 30, 2011, 9:11:40 AM6/30/11
to google-app...@googlegroups.com
aleee@zeroKilled:~/Desktop$ curl --data "@member.xml" --request POST --header "Content-Type: application/atom+xml" --header "Authorization: GoogleLogin auth=DQAAAPcAAAAhTBOiL9FRXGWmNOm7xUoeezpntQMWjAfZ1S_F9n38tR1qnhFE_s9biAGkYPywc9_khyhqVEsOA9-9OpSrqN6iAbO0lcAQLnrbfL89ABtTiEo6c8Nw3YsYhejmcQcvJ8nyQYGTFecCP0L6jrWIUmkuPhFSqd0lQye34lAq4Zy6ARjUSvM4ugYcbjGCx1F59gqdrvdc2kHLjPz2W8LEhcFuxrPaQyMjB0jelw1BvBoljKUnly3w3qh9-0JLOXfRSu_098XoyX0Y869K-IbZjL2-WJSA9i6Yr1LQMz0aOyjaA3390YflIDoGuYW6d7nns-XXI8FS2PtLWE7PeOrn832S" "https://apps-apis.google.com/a/feeds/group/2.0/mydomain.com.com/69510712/member"

Claudio Cherubino

unread,
Jun 30, 2011, 9:16:38 AM6/30/11
to google-app...@googlegroups.com
Is 69510712 a valid group identifier in your domain?
Is your domain spelled correctly?
Is the email address specified in member.xml a valid one?

I'd also recommend not to post your Auth token in a public forum.

Claudio

Alexandre Jacquet

unread,
Jun 30, 2011, 9:19:04 AM6/30/11
to google-app...@googlegroups.com
Ok, i will change the password.

About the group identified, user and domain are ok, all the exists.

Claudio Cherubino

unread,
Jun 30, 2011, 9:20:16 AM6/30/11
to google-app...@googlegroups.com
Send me all the details in a private mail so that I can check.

Claudio

Alexandre Jacquet

unread,
Jul 1, 2011, 11:03:37 AM7/1/11
to google-app...@googlegroups.com
Hey guys,

Just for knowledge the problem was in how many groups the user belonged. He was in more less 4,900 groups.

Jan Zawadzki / Hapara

unread,
Jul 5, 2011, 6:26:22 AM7/5/11
to Google Apps Domain Information and Management APIs
So... was the problem fixed?? The number of groups is high, but not
*that* high....

Jan

On Jul 2, 3:03 am, Alexandre Jacquet <alejacq...@ajsolutions.me>
wrote:
> Hey guys,
>
> Just for knowledge the problem was in how many groups the user belonged. He
> was in more less 4,900 groups.
>
> Alexandre Jacquet
>
> Google Apps Deployment Specialst
> São Paulo | SP | Brasil
> Tel.: 55 11 8064 6882
>
> On Thu, Jun 30, 2011 at 10:20 AM, Claudio Cherubino
> <ccherub...@google.com>wrote:
>
>
>
>
>
>
>
> > Send me all the details in a private mail so that I can check.
>
> > Claudio
>
> > On Thu, Jun 30, 2011 at 2:19 PM, Alexandre Jacquet <
> > alejacq...@ajsolutions.me> wrote:
>
> >> Ok, i will change the password.
>
> >> About the group identified, user and domain are ok, all the exists.
>
> >> Alexandre Jacquet
>
> >> Google Apps Deployment Specialst
> >> São Paulo | SP | Brasil
> >> Tel.: 55 11 8064 6882
>
> >> On Thu, Jun 30, 2011 at 10:16 AM, Claudio Cherubino <
> >> ccherub...@google.com> wrote:
>
> >>> Is 69510712 a valid group identifier in your domain?
> >>> Is your domain spelled correctly?
> >>> Is the email address specified in member.xml a valid one?
>
> >>> I'd also recommend not to post your Auth token in a public forum.
>
> >>> Claudio
>
> >>> On Thu, Jun 30, 2011 at 2:11 PM, Alexandre Jacquet <
> >>> alejacq...@ajsolutions.me> wrote:
>
> >>>> aleee@zeroKilled:~/Desktop$ curl --data "@member.xml" --request POST
> >>>> --header "Content-Type: application/atom+xml" --header "Authorization:
> >>>> GoogleLogin
> >>>> auth=DQAAAPcAAAAhTBOiL9FRXGWmNOm7xUoeezpntQMWjAfZ1S_F9n38tR1qnhFE_s9biAGkYP ywc9_khyhqVEsOA9-9OpSrqN6iAbO0lcAQLnrbfL89ABtTiEo6c8Nw3YsYhejmcQcvJ8nyQYGTF ecCP0L6jrWIUmkuPhFSqd0lQye34lAq4Zy6ARjUSvM4ugYcbjGCx1F59gqdrvdc2kHLjPz2W8LE hcFuxrPaQyMjB0jelw1BvBoljKUnly3w3qh9-0JLOXfRSu_098XoyX0Y869K-IbZjL2-WJSA9i6 Yr1LQMz0aOyjaA3390YflIDoGuYW6d7nns-XXI8FS2PtLWE7PeOrn832S"
> >>>> "https://apps-apis.google.com/a/feeds/group/2.0/mydomain.com.com/*
> >>>> 69510712*/member"
> >>>>  <?xml version="1.0" encoding="UTF-8"?>
> >>>> <AppsForYourDomainErrors>
> >>>>   <error errorCode="1801" invalidInput="" reason="InvalidValue" />
> >>>> </AppsForYourDomainErrors>
>
> >>>> Alexandre Jacquet
>
> >>>> Google Apps Deployment Specialst
> >>>> São Paulo | SP | Brasil
> >>>> Tel.: 55 11 8064 6882
>
> >>>> On Thu, Jun 30, 2011 at 10:09 AM, Alexandre Jacquet <
> >>>> alejacq...@ajsolutions.me> wrote:
>
> >>>>> Even in MDM ?
>
> >>>>> Alexandre Jacquet
>
> >>>>> Google Apps Deployment Specialst
> >>>>> São Paulo | SP | Brasil
> >>>>> Tel.: 55 11 8064 6882
>
> >>>>> On Thu, Jun 30, 2011 at 9:53 AM, Claudio Cherubino <
> >>>>> ccherub...@google.com> wrote:
>
> >>>>>> The groupId specified in your url is incorrect, it should be 69510712
> >>>>>> instead of 69510...@mydomain.com.
>
> >>>>>> Claudio
>
> >>>>>> On Thu, Jun 30, 2011 at 1:50 PM, Alexandre Jacquet <
> >>>>>> alejacq...@ajsolutions.me> wrote:
>
> >>>>>>> Hello Claudio,
>
> >>>>>>> It helped alot.
>
> >>>>>>> As requested the cURL output.
>
> >>>>>>> member.xml
> >>>>>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>>>> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="
> >>>>>>>http://schemas.google.com/apps/2006" xmlns:gd="
> >>>>>>>http://schemas.google.com/g/2005">
> >>>>>>>     <apps:property name="memberId" value="myu...@mydomain.com"/>
> >>>>>>> </atom:entry>
>
> >>>>>>> aleee@zeroKilled:~/Desktop$ curl --data "@member.xml" --request POST
> >>>>>>> --header "Content-Type: application/atom+xml" --header "Authorization:
> >>>>>>> GoogleLogin
> >>>>>>> auth=DQAAAPcAAAAhTBOiL9FRXGWmNOm7xUoeezpntQMWjAfZ1S_F9n38tR1qnhFE_s9biAGkYP ywc9_khyhqVEsOA9-9OpSrqN6iAbO0lcAQLnrbfL89ABtTiEo6c8Nw3YsYhejmcQcvJ8nyQYGTF ecCP0L6jrWIUmkuPhFSqd0lQye34lAq4Zy6ARjUSvM4ugYcbjGCx1F59gqdrvdc2kHLjPz2W8LE hcFuxrPaQyMjB0jelw1BvBoljKUnly3w3qh9-0JLOXfRSu_098XoyX0Y869K-IbZjL2-WJSA9i6 Yr1LQMz0aOyjaA3390YflIDoGuYW6d7nns-XXI8FS2PtLWE7PeOrn832S"
> >>>>>>> "
> >>>>>>> https://apps-apis.google.com/a/feeds/group/2.0/mydomain.com/69510...@mydomain.com/member
> >>>>>>> "
>
> >>>>>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>>>> <AppsForYourDomainErrors>
> >>>>>>>   <error errorCode="1801" invalidInput="" reason="InvalidValue" />
> >>>>>>> </AppsForYourDomainErrors>
>
> >>>>>>> Alexandre Jacquet
>
> >>>>>>> Google Apps Deployment Specialst
> >>>>>>> São Paulo | SP | Brasil
> >>>>>>> Tel.: 55 11 8064 6882
>
> >>>>>>> On Thu, Jun 30, 2011 at 7:44 AM, Claudio Cherubino <
> >>>>>>> ccherub...@google.com> wrote:
>
> >>>>>>>> Download curl fromhttp://curl.haxx.se/then run the following
> >>>>>>>> command to perform ClientLogin (of course, put your credentials):
>
> >>>>>>>> curlhttps://www.google.com/accounts/ClientLogin--request POST -d
> >>>>>>>> Email=ad...@domain.com -d Passwd=mypassword -d accountType=HOSTED
> >>>>>>>> -d service=apps
>
> >>>>>>>> From the output of the previous command, copy the Auth token.
> >>>>>>>> Then create a file named member.xml with the following content:
>
> >>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>>>>> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="
> >>>>>>>>http://schemas.google.com/apps/2006" xmlns:gd="
> >>>>>>>>http://schemas.google.com/g/2005">
> >>>>>>>>     <apps:property name="memberId" value="susanjo...@example.com"/>
> >>>>>>>> </atom:entry>
>
> >>>>>>>> Run the following command to add a member to a group:
>
> >>>>>>>> curl --data "@member.xml" --request POST --header "Content-Type:
> >>>>>>>> application/atom+xml" --header "Authorization: GoogleLogin
> >>>>>>>> auth=PUT_THE_AUTH_TOKEN_HERE" "
> >>>>>>>>https://apps-apis.google.com/a/feeds/group/2.0/domain.com/groupid/member
> >>>>>>>> "
>
> >>>>>>>> Hope it helps
> >>>>>>>> Claudio
>
> >>>>>>>> On Thu, Jun 30, 2011 at 10:39 AM, Alexandre Jacquet <
> >>>>>>>> alejacq...@ajsolutions.me> wrote:
>
> >>>>>>>>> Actually claudio i dont know how to use curl if you could explain
> >>>>>>>>> how do i make the request
>
> >>>>>>>>> Sorry
> >>>>>>>>> On Jun 30, 2011 6:33 AM, "Claudio Cherubino" <
> ...
>
> read more »

Claudio Cherubino

unread,
Jul 5, 2011, 6:40:05 AM7/5/11
to google-app...@googlegroups.com
All limits for the Provisioning API are defined at:


Claudio


--

Jan Zawadzki / Hapara

unread,
Jul 29, 2011, 6:58:58 AM7/29/11
to Google Apps Domain Information and Management APIs
Wish I could +1 that post Claudio... Good stuff.

On Jul 5, 10:40 pm, Claudio Cherubino <ccherub...@google.com> wrote:
> All limits for the Provisioning API are defined at:
>
> http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_...
> > > >>>>>>>> Download curl fromhttp://curl.haxx.se/thenrun the following
> ...
>
> read more »

Claudio Cherubino

unread,
Jul 29, 2011, 12:11:47 PM7/29/11
to google-app...@googlegroups.com
Well...you can!
Just go to the top of the page, there's a +1 button on the right in the bar above "Google Apps Provisioning API Developer's Guide: Protocol".

Claudio

> ...
>
> read more »

Reply all
Reply to author
Forward
0 new messages