如何通过Admin-SDK API为管理员用户获取组织名称? [英] How to get Organisation Name via Admin-SDK APIs for the admin user?

查看:106
本文介绍了如何通过Admin-SDK API为管理员用户获取组织名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想通过OAuth2 access_token使用Google API的Admin-SDK之一,以从Marketplace获取向我们的应用程序注册的客户端的组织名称. 该文档说,我要做的就是查询以下URL以获取组织名称

We want to use one of the Google API's Admin-SDK via OAuth2 access_token to get the Organization Name of the client who registers with our App from the Marketplace. The documentation says, all I need to do is query the below URL to get Organization Name

http://apps-apis.google.com/a/feeds/domain/2.0/{domainName}/general/organizationName

http: // apps-apis.google.com/a/feeds/domain/2.0/{domainName}/general/organizationName

并且正如预期的那样,我们将https://apps-apis.google.com/a/feeds/domain/设置为范围参数之一

And as expected, we have set https: // apps-apis.google.com/a/feeds/domain/ as one of scope parameter

有人可以解释一下我应该怎么做吗,我已经为注册的管理员用户使用了access_token.

Can any one explain me how should I do this provided, I have access_token for the admin user who registered.

应称为

https://apps-apis.google.com/a/feeds/domain/2.0/{domainName}/general/organizationName?access_token = $ {ACCESS_TOKEN}

https: // apps-apis.google.com/a/feeds/domain/2.0/{domainName}/general/organizationName?access_token=${ACCESS_TOKEN}

我应该将一些标头传递给它,以获得组织名称吗?

Should I pass some headers to it, to get the organisation name?

是否可以使用Google API做到这一点? (类型为www.googleapis.com/auth ...)

Is it possible to do this with Google APIs ? ( of the type www.googleapis.com/auth ... )

推荐答案

我建议使用获取用户或列表/搜索.

I'd recommend using the newer, OAuth2-based APIs that is under https://www.googleapis.com/admin/directory/v1/users. You can either GET a user or LIST/search.

这篇关于如何通过Admin-SDK API为管理员用户获取组织名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆