Move user to the root organization unit

59 views
Skip to first unread message

David Rubert

unread,
Jul 6, 2011, 6:58:14 AM7/6/11
to google-app...@googlegroups.com
Hi,
I'm trying to move a user which was moved to an organizational unit back to the root org_unit_path, but I can't accomplish it.

I'm using this call of the API documentation:


But I don't know which value needs the "parentOrgUnitPath" to move a user back to the root organization unit. I have tried with "", "/" (url-encoded) with no luck, I always obtain a 400 error:

AppsForYourDomainException: {'status': 400, 'body': 'Invalid request URI', 'reason': 'Bad Request'}

¿Any clues?

Michael Manoochehri

unread,
Jul 6, 2011, 1:56:42 PM7/6/11
to google-app...@googlegroups.com
Hi David:

It's hard to tell what might be causing the 400 response without seeing the GData XML that you are posting. However, the path of the root org unit should be "/".

Can you share an example of the XXML you are posting?

Michael

Michael Manoochehri

unread,
Jul 6, 2011, 1:57:14 PM7/6/11
to google-app...@googlegroups.com
Sorry... I meant "XML" :-)

David Rubert

unread,
Jul 8, 2011, 4:26:49 AM7/8/11
to google-app...@googlegroups.com
Hi Michael, thanks for your response. I post an example of the XML I'm sending.


<?xml version=\'1.0\' encoding=\'UTF-8\'?>
  <ns1:property name="usersToMove" value="us...@uji.es" />
  <ns1:property name="parentOrgUnitPath" value="/" />
</ns0:entry>'

The response obtained is:

{'status': 400, 'body': '<?xml version="1.0" encoding="UTF-8"?>\r\n<AppsForYourDomainErrors>\r\n <error errorCode="1301" invalidInput="orgUnit" reason="EntityDoesNotExist" />\r\n
</AppsForYourDomainErrors>\r\n\r\n', 'reason': 'Bad Request'}



Thanks for your help.


Claudio Cherubino

unread,
Jul 8, 2011, 12:48:48 PM7/8/11
to google-app...@googlegroups.com
Hi David,

To move an user to a different OU (including the root), you can follow the instructions at


and send a PUT request to 

https://apps-apis.google.com/a/feeds/orguser/2.0/the customerId/the organization user's email

with the following body:

<?xml version="1.0" encoding="UTF-8"?>
<apps:property name="oldOrgUnitPath" value="current OU" />
<apps:property name="orgUnitPath" value="new OU" />
</atom:entry>

If you want to move the user to the root, just specify "/" as "orgUnitPath".
Hope it helps

Claudio



--
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/-/e5qmnJbNlo8J.

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.

David Rubert

unread,
Jul 11, 2011, 4:12:00 AM7/11/11
to google-app...@googlegroups.com
It worked like a charm!

Thanks for the help.

Mike Porter

unread,
Jul 28, 2011, 2:35:53 PM7/28/11
to google-app...@googlegroups.com
While this solves the immediate problem, it does not explain how the usersToMove option should work.  Presumably, if we wish to move large numbers of users to the root OU, this would be the best approach.  However, I too can not get this too work.  Can we have either a documentation change or a bug report submitted?  Either usersToMove should be able to move users to the root OU and the code should work or change the documentation.

Thanks,

Mike

Alexandre Jacquet

unread,
Jul 28, 2011, 2:38:18 PM7/28/11
to google-app...@googlegroups.com
Hello Mike,

So far it is only allowed to move 20 users by request but you can do a multi thread application that runs 20 requests per thread. :)



                                                                                           

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.
Reply all
Reply to author
Forward
0 new messages