This Choreo lists all labels in the user's mailbox. The documentation for this Gmail resource can be found here.
Note: this method requires that you request one of the following scopes during the OAuth process:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
The Fields input can be used to reduce the number of fields returned in the response. The syntax for using this parameter is loosely based on XPath. Below are some points to remember when using this input:
- Fields should be separated by commas.
- When fields are nested within other fields, you can refer to them using a path (i.e. urls/value).
- Specify field sub-selectors to request only specific sub-fields by using parentheses "( )" after any selected field.
Here is an example of acceptable inputs:
ClientID: {YOUR CLIENT ID}
ClientSecret: {YOUR CLIENT SECRET}
RefreshToken: {YOUR REFRESH TOKEN}
The following is a sample of the JSON information returned by this Choreo:
{
"labels": [
{
"id": "Label_8",
"name": "Archive/Drafts",
"type": "user"
},
{
"id": "Label_12",
"name": "[Imap]/Trash",
"type": "user"
},
{
"id": "DRAFT",
"name": "DRAFT",
"messageListVisibility": "hide",
"labelListVisibility": "labelShow",
"type": "system"
},
{
"id": "Label_15",
"name": "UnitTests",
"messageListVisibility": "show",
"labelListVisibility": "labelShow",
"type": "user"
},
{
"id": "UNREAD",
"name": "UNREAD",
"type": "system"
},
{
"id": "CATEGORY_UPDATES",
"name": "CATEGORY_UPDATES",
"type": "system"
},
{
"id": "INBOX",
"name": "INBOX",
"messageListVisibility": "hide",
"labelListVisibility": "labelShow",
"type": "system"
},
{
"id": "CATEGORY_PROMOTIONS",
"name": "CATEGORY_PROMOTIONS",
"type": "system"
},
{
"id": "CATEGORY_SOCIAL",
"name": "CATEGORY_SOCIAL",
"messageListVisibility": "hide",
"labelListVisibility": "labelShow",
"type": "system"
},
{
"id": "CATEGORY_PERSONAL",
"name": "CATEGORY_PERSONAL",
"type": "system"
},
{
"id": "CATEGORY_FORUMS",
"name": "CATEGORY_FORUMS",
"type": "system"
},
{
"id": "Label_9",
"name": "Archive/Outbox",
"type": "user"
},
{
"id": "TRASH",
"name": "TRASH",
"messageListVisibility": "hide",
"labelListVisibility": "labelHide",
"type": "system"
},
{
"id": "Label_11",
"name": "Archive/News Feed",
"type": "user"
},
{
"id": "Label_4",
"name": "[Imap]/Sent",
"type": "user"
},
{
"id": "STARRED",
"name": "STARRED",
"messageListVisibility": "hide",
"labelListVisibility": "labelShow",
"type": "system"
},
{
"id": "SPAM",
"name": "SPAM",
"messageListVisibility": "hide",
"labelListVisibility": "labelHide",
"type": "system"
},
{
"id": "SENT",
"name": "SENT",
"messageListVisibility": "hide",
"labelListVisibility": "labelShow",
"type": "system"
},
{
"id": "Label_10",
"name": "Archive/Quick Step Settings",
"type": "user"
},
{
"id": "Label_3",
"name": "Junk E-mail",
"messageListVisibility": "show",
"labelListVisibility": "labelHide",
"type": "user"
}
]
}