Method: users.labels.list

列出使用者信箱中的所有標籤。

HTTP 要求

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

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
userId

string

使用者的電子郵件地址。特殊值 me 可用於表示已驗證使用者。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體即會包含具有以下結構的資料:

JSON 表示法
{
  "labels": [
    {
      object (Label)
    }
  ]
}
欄位
labels[]

object (Label)

標籤清單。請注意,每個標籤資源都只包含 idnamemessageListVisibilitylabelListVisibilitytypelabels.get 方法可擷取額外的標籤詳細資料。

授權範圍

需要下列其中一種 OAuth 範圍:

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

詳情請參閱授權指南