Method: users.getProfile

获取当前用户的 Gmail 个人资料。

HTTP 请求

GET https://gmail.googleapis.com/gmail/v1/users/{userId}/profile

网址采用 gRPC 转码语法。

路径参数

参数
userId

string

用户的电子邮件地址。特殊值 me 可用于指示经过身份验证的用户。

请求正文

请求正文必须为空。

响应正文

Gmail 用户的个人资料。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "emailAddress": string,
  "messagesTotal": integer,
  "threadsTotal": integer,
  "historyId": string
}
字段
emailAddress

string

用户的电子邮件地址。

messagesTotal

integer

邮箱中的邮件总数。

threadsTotal

integer

邮箱中的会话总数。

historyId

string

邮箱当前历史记录的 ID。

授权范围

需要以下 OAuth 范围之一:

  • https://mail.google.com/
  • https://www.googleapis.com/auth/gmail.modify
  • https://www.googleapis.com/auth/gmail.compose
  • https://www.googleapis.com/auth/gmail.readonly
  • https://www.googleapis.com/auth/gmail.metadata

有关详情,请参阅授权指南