Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 谷歌-目录API(管理SDK)创建组-错误_Python_Rest_Api_Google Cloud Platform_Command Line Interface - Fatal编程技术网

Python 谷歌-目录API(管理SDK)创建组-错误

Python 谷歌-目录API(管理SDK)创建组-错误,python,rest,api,google-cloud-platform,command-line-interface,Python,Rest,Api,Google Cloud Platform,Command Line Interface,我目前正在跟随谷歌,并尝试使用RESTAPI的不同方法。本教程设计为在命令行中运行,并通过创建一个我已设法更改教程代码的组来使用O Auth 2.0进行身份验证,以便我可以将用户插入到已存在的组中,方法是传递我希望插入用户的组的groupKey和包含我正在添加的用户电子邮件的正文,然而,我不能上班 我得到的错误是: googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.

我目前正在跟随谷歌,并尝试使用RESTAPI的不同方法。本教程设计为在命令行中运行,并通过创建一个我已设法更改教程代码的组来使用O Auth 2.0进行身份验证,以便我可以将用户插入到已存在的组中,方法是传递我希望插入用户的组的groupKey和包含我正在添加的用户电子邮件的正文,然而,我不能上班

我得到的错误是:

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/admin/directory/v1/users?alt=json returned "Insufficient Permission">
谢谢你花时间阅读这篇文章,我希望很快能收到你们当中一些人的回复


一个充满希望的程序员。

我在查看了谷歌云项目中的错误日志后找到了解决方案,而这只是一个简单的修复。 之前:

之后:

group = service.groups().insert(body = test).execute()
在这里,您可以看到我已将service.users更改为service.groups

我不能相信我让这样一个简单的错误过去了,但离开这里,以防这会帮助别人

谢谢

您可以按照链接在谷歌目录中创建一个组。

给您:
group = service.users().insert(body = test).execute()
group = service.groups().insert(body = test).execute()