获取当前用户的 Gmail 个人资料。
HTTP 请求
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/profile
网址采用 gRPC 转码语法。
路径参数
| 参数 | |
|---|---|
| userId | 
 用户的电子邮件地址。特殊值  | 
请求正文
请求正文必须为空。
响应正文
Gmail 用户的个人资料。
如果成功,响应正文将包含结构如下的数据:
| JSON 表示法 | 
|---|
| { "emailAddress": string, "messagesTotal": integer, "threadsTotal": integer, "historyId": string } | 
| 字段 | |
|---|---|
| emailAddress | 
 用户的电子邮件地址。 | 
| messagesTotal | 
 邮箱中邮件的总数。 | 
| threadsTotal | 
 邮箱中的会话总数。 | 
| historyId | 
 邮箱的当前历史记录的 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
如需了解详情,请参阅授权指南。