Get labels from Zoho Mail
Table of Contents
Overview
The zoho.mail.getLabels task is used to retrieve all the label names from your Zoho Mail account.
Syntax
<response> = zoho.mail.getLabels(<connection>);
where,
Params | Data type | Description |
<response> | KEY-VALUE | The response that represents the color, id, and name of each label. |
<connection> | TEXT | The link name of the connection. Note:
|
Example
The following script retrieves all labels from Zoho Mail:
response = zoho.mail.getLabels("mail_oauth_connection");
where:
response
"mail_oauth_connection"
Response Format
Success Response
The success response will be returned in the following format:
{
"COLOR":"#FFD700",
"ID":6729326000000008027,
"NAME":"Notification"
},
{
"COLOR":"#FFD700",
"ID":6729326000000008029,
"NAME":"NewsLetter"
},
{
"COLOR":"#FFD700",
"ID":6729326000000008031,
"NAME":"Blog"
}
To fetch the IDs of the tags from the success response obtained, execute the following snippet:
for each var in <response_variable> { info var.get("ID"); }
To fetch the names of the tags from the success response obtained, execute the following snippet:
for each var in <response_variable> { info var.get("NAME"); }