Get labels from Zoho Mail
Table of Contents
Note:
- This task is applicable to all Zoho services, except Zoho Creator.
- Each time the zoho.mail.getLabels integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.mail.getLabels integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
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
The KEY-VALUE response that represents the details of the labels fetched from Zoho Mail.
"mail_oauth_connection"
The TEXT that represents the link name of Zoho 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"); }