Python Google Admin SDK错误资源未找到:尝试列出现有用户时的域

Python Google Admin SDK错误资源未找到:尝试列出现有用户时的域,python,google-apps,google-directory-api,Python,Google Apps,Google Directory Api,我正试图编写一个简单的脚本,使用谷歌的python API获取我的谷歌应用程序用户列表。到目前为止,它看起来是这样的(基于谷歌的一个例子): 该服务帐户已在google开发者控制台上获得以下API的授权: 但是,当我运行代码时,会出现以下错误: An error occurred: <HttpError 404 when requesting https://www.googleapis.com/admin/directory/v1/users?customer=my_customer

我正试图编写一个简单的脚本,使用谷歌的python API获取我的谷歌应用程序用户列表。到目前为止,它看起来是这样的(基于谷歌的一个例子):

该服务帐户已在google开发者控制台上获得以下API的授权:

但是,当我运行代码时,会出现以下错误:

An error occurred: <HttpError 404 when requesting https://www.googleapis.com/admin/directory/v1/users?customer=my_customer&alt=json returned "Resource Not Found: domain"> 
发生错误:
有没有关于我遗漏了什么的线索


E.

即使使用服务帐户,您仍然需要在域中“扮演”具有适当权限的谷歌应用程序用户(例如超级管理员)。尝试:

在哪里admin@domain.com是您域中超级管理员的电子邮件

An error occurred: <HttpError 404 when requesting https://www.googleapis.com/admin/directory/v1/users?customer=my_customer&alt=json returned "Resource Not Found: domain"> 
credentials = SignedJwtAssertionCredentials(client_email, private_key,
                        OAUTH_SCOPE, sub='admin@domain.com')