Today one of our apps API developers asked me for a code example 
demonstrating how to retrieve all organization users on a domain using the 
Provisioning API.

You can use the Google Labs Organization Unit methods of the Provisioning 
API. Below is a short snippet of using these new organization service found 
in the latest release of the GData-Python 
Library:  (http://code.google.com/p/gdata-python-client/ )

- Michael

# Import the gdata module methods 
import gdata.apps.organization.service 

# login parameters for Authentication... 
testAdminEmail = "[email protected]" 
testDomain = "yourdomain.com" 
testPassword = "some_test_password" 

# Create a new authenticated AppsService object to make calls to the API 
service = 
gdata.apps.organization.service.OrganizationService(email=testAdminEmail, 
domain=testDomain, password=testPassword) 
service.ProgrammaticLogin() 

# Request the Customer Id 
customerId = service.RetrieveCustomerId()["customerId"] 
print "Customer ID is: " + customerId 

# display all users in Org Units  with the RetrieveAllOrgUsers method
print service.RetrieveAllOrgUsers(customerId) 


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