如何使用Java API创建和访问Gmail帐户详细信息? [英] How to Create And Access Gmail Account Details using Java APIs?

查看:119
本文介绍了如何使用Java API创建和访问Gmail帐户详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java API创建一个Gmail帐户,并且还想访问现有gmail用户的基本详细信息.我尝试了很多站点,但无法编写代码.帮我提供代码段

I want to create a gmail account using java APIs and also want to access the basic details of the existing gmail user. I tried a lot of sites but not able to write a code. help me with a code snippet

先谢谢您

推荐答案

Gmail API文档显示,此API尚未添加Gmail帐户创建功能.当前,您可以使用Gmail API添加Gmail功能,例如:

As far as the Gmail API documentation shows, creation of Gmail account isn't an added feature yet for this API. Currently, you can use Gmail API to add Gmail features like:

  • 从Gmail阅读邮件
  • 发送电子邮件
  • 修改应用于消息和线程的标签
  • 搜索特定的消息和主题
  • 创建过滤器以自动标记,转发或存档邮件

因此,如果您要创建用户帐户,则可以选择使用授权请求中所述的授权,您可以可以使用以下格式发送HTTP请求:

So, if you wish to create a user account, an option that you can do is to use the Users: insert of Google Apps Admin SDK - Directory API. With the inclusion of the authorization described in Authorize requests, you may send HTTP request using the following format:

POST https://www.googleapis.com/admin/directory/v1/users

在请求正文中,为用户的资源提供文档中提供的可用属性.

In the request body, supply user's resources with the available properties that are given in the documentation.

同样,您也可以使用目录API:用户帐户.您可以使用 GET 请求检索用户,并包括授权.格式为:

Likewise, you can access the basic details of an existing gmail user also with the use of Directory API: User Accounts. You can retrieve a user using the GET request and include also the authorization. Format is:

GET https://www.googleapis.com/admin/directory/v1/users/userKey

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