Choose where you’d like to start

Set Flag

Note: This task is applicable to all Zoho services, except Zoho Creator.

Overview

The zoho.mail.setFlag task is used to flag an email in Zoho Mail.

Syntax

<response> = zoho.mail.setFlag(<message_id>, <flag_name>, <connection>);

where:

Params Data typeDescription

<response> 

KEY-VALUE

The response returned representing the status of the executed task.

<message_id> 

NUMBER

The ID of the email that will be flagged.

Note: You can get the message_id from the Zoho Mail URL. The URL is in the following format:
https://mail.zoho.com/zm/#mail/folder/<folder_id>/p/<message_id>

<flag_name>

TEXT

The name of the flag.

Allowed values:

  • info
  • followup
  • important

<connection> 

TEXT

The link name of the Zoho Mail connection

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • The scope required for this task as mentioned by Zoho Mail API is messages.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example : Flag an email as important in Zoho Mail

The following script flags the specified email as important in Zoho Mail:

response = zoho.mail.setFlag(6729326000000548039, "important", "mail_oauth_connection");

where:

response
The KEY-VALUE response that represents the status of the executed task.
6729326000000548039
The NUMBER that represents the ID of the email that will be flagged.
"important"
The TEXT that represents the flag name.
"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:

{  
   "message":"Action markFlag is successful",
   "status":"success"
}

Related Links

Get Started Now

Execute