google-apigoogle-admin-sdkgoogle-admin-settings-api

Get list of domains for an Organization using Google Apps Admin SDK?


An organization in Google Apps can have multiple domains.

API requests to the Admin SDK require the domain name as a parameter. Ex:

https://apps-apis.google.com/a/feeds/domain/2.0/{domainName}/general/defaultLanguage

Is there a way to programatically list all domains for an organization? If, for example, you wanted to change the lanaguage for all domains in an organization, there doesn't seem to be any way to list/iterate through the domains.


Solution

  • You cannot set separate policies or Admin Settings API per a domain when the domains are in the same Google Apps instance. See the Google Limitations for multiple domains document.

    To answer your first question, the Admin SDK does not have a method that allows the retrieval of all domains. However, you can retrieve all users in the Google Apps instance and use that to determine what domains users have been created in.