简体   繁体   English

使用Google Admin SDK API(python)的示例

[英]Examples for using Google Admin SDK API (python)

We use Google Apps at my organization. 我们在我的组织中使用Google Apps。 I am trying to just use my API key (no oauth2) to get access to users info through the Directory API in the Admin SDK. 我试图只使用我的API密钥(没有oauth2)通过Admin SDK中的Directory API访问用户信息。 I cannot find useful examples and the Google docs are buggy. 我找不到有用的示例,Google文档也是错误的。 I have had a great deal of difficulty with Google's API documentation. 我对Google的API文档遇到了很大的困难。 Or perhaps I have to use oauth2? 或许我必须使用oauth2?

Even if I knew some of the details about this specific API, I can't find sample code for using these APIs in Python. 即使我知道有关此特定API的一些细节,我也找不到在Python中使用这些API的示例代码。 Does anyone have sample code or links to real-world samples? 有没有人有示例代码或指向真实世界样本的链接? I am new to Python and we're working on the App Engine. 我是Python新手,我们正在开发App Engine。

You must use OAuth2 authentication, API key alone is not enough as you must authenticate as a Google Apps super admin or delegated admin (with appropriate rights) in order to perform Admin SDK Directory operations. 您必须使用OAuth2身份验证,仅凭API密钥是不够的,因为您必须作为Google Apps超级管理员或委派管理员(具有适当的权限)进行身份验证才能执行Admin SDK目录操作。

My project, Dito GAM was recently updated with full support for Admin SDK calls. 我的项目Dito GAM最近更新时完全支持Admin SDK调用。 It makes use of most (all?) Directory API calls. 它使用了大多数(所有?)Directory API调用。 See: 看到:

https://code.google.com/p/google-apps-manager/source/browse/trunk/gam.py https://code.google.com/p/google-apps-manager/source/browse/trunk/gam.py

Also, if you notice bugs or ambiguities in the Google documentation, be sure to report them. 此外,如果您发现Google文档中存在错误或含糊之处,请务必报告错误。 It won't get any better if someone doesn't tell them about it! 如果有人不告诉他们,它将不会变得更好! Use the "Report a bug" link at the bottom of all developers.google.com pages. 使用所有developers.google.com页面底部的“报告错误”链接。 It's very simple to use and pinpoint the exact issue. 它使用起来非常简单,并确定了确切的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM