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=
[email protected] -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="[email protected]"/>
</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 <
[email protected]> 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" <[email protected]>
> wrote:
> > 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
> >
> > On Thu, Jun 30, 2011 at 12:58 AM, Alexandre Jacquet <
> > [email protected]> wrote:
> >
> >> 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.
> >>
> >> // POST
> http://apps-apis.google.com/a/feeds/group/2.0/domain/groupId/owner
> >> 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);
> >> }
> >>
> >> // POST
> >> https://apps-apis.google.com/a/feeds/group/2.0/domain/groupId/member
> >> 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);
> >> }
> >>
> >>
> >>
> >> 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 <
> >> [email protected]> 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 <
> >>> [email protected]> 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.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Alexandre Jacquet
> >>>>
> >>>> Google Apps Deployment Specialst
> >>>> São Paulo | SP | Brasil
> >>>> Tel.: 55 11 8064 6882
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Wed, Jun 29, 2011 at 8:30 PM, Michael Manoochehri <
> >>>> [email protected]> wrote:
> >>>>
> >>>>> 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
> >>>>>
> >>>>> --
> >>>>> 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
> >>>>> [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.
> >>>>>
> >>>>
> >>>>
> >>>
> >> --
> >> 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.
> >>
> >
> > --
> > 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.
> >
>
> --
> 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.
>

-- 
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