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

詳情請參閱授權指南