I'm using the Google data Python client library to import emails into my users account.
If this is working fine for users in the primary domain, I get an error for users in a separate domain.
from gdata.apps.migration import service
user = "user@example.fr"
admin = "admin@example.com"
admin_pwd = "hackme"
srv = service.MigrationService(email = admin, password = admin_pwd, domain = "example.com")
So if I set domain
to the primary one, I get the following error message when I try to submit the batch:
gdata.apps.service.AppsForYourDomainException: {'status': 403, 'body': '<HTML>\n<HEAD>\n<TITLE>Authorization failed. Ensure that the destination user exists and try again.</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Authorization failed. Ensure that the destination user exists and try again.</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n', 'reason': 'Authorization failed. Ensure that the destination user exists and try again.'}
If I set no domain name, I get this one instead:
gdata.apps.service.AppsForYourDomainException: {'status': 403, 'body': '<HTML>\n<HEAD>\n<TITLE>Invalid domain.</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Invalid domain.</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n', 'reason': 'Invalid domain.'}
I can understand why I get those errors but the question is: can I import users emails on a separate domain? If so, how?