I have a reseller account with Google Apps For Business. I am using the google-api-php-client SDK for PHP from the GitHub repository:
https://github.com/google/google-api-php-client
I have already created the customer account as a reseller. I have verified the primary domain using the site verification service. I am trying to add a domain alias to the primary domain for the customers account. I am not seeing any documentation for this process in the API. I know how to do this using the admin panel. I also know how to add an alias for the users email, however, I do not want a user alias because I will be migrating hundreds of email accounts and need the domain alias.
Does anyone know of how to accomplish this using the above API or use a custom request?
If this question is too vague please let me know.
None such option exists in the current Admin SDK or the Reseller API.
Assuming there are no restrictions on a reseller account that would prevent it, you can manage DomainAliases including adding and alias through the Directory API using the following post request (replacing 'myalias.com' and 'parentdomain.com' with your values; you will need to include your authorization token Authorization header).
POST https://www.googleapis.com/admin/directory/v1/customer/my_customer/domainaliases
Authorization: Bearer xxx-token-xxx
Content-Type: application/json
{
"domainAliasName": "myalias.com",
"parentDomainName": "parentdomain.com"
}
The documentation for this API method includes the APIs Explorer providing a convenient form for test this API call. When completing the form on this page, enter 'my_customer' in the customer field.