Flag Emails
Purpose
This API is used to apply a flag to a single or multiple emails.
OAuth Scope
Use the scope
MailApps.messages.ALL (or) MailApps.messages.UPDATE
ALL - Full access to the messages.
UPDATE - Flag emails.
To generate Authtoken, refer here.
Request URL
Method: PUT
https://mail360.zoho.com/api/accounts/{account_key}/messages
Path Parameters
- account_key* string
- This key is used to identify the account. It is generated during account addition.
- This parameter can be fetched from Get all accounts API.
Request Body (JSON Object)
- mode* string
- This parameter represents the type of operation that is to be performed.
- Provide the value as setFlag.
- messageId* JSON Array of long
- This parameter should be passed as an array of single or multiple message IDs of emails that need to be flagged. Each message ID serves as a unique identifier for an email or message.
- flagid* string
- This parameter is passed to update emails with the specific flag.
- The value can be
- info
- important
- followup
- flag_not_set
- The default value is flag_not_set.
* - Mandatory parameter
Note:
While the Messages APIs focus on individual messages, the Threads APIs deal with entire conversation threads, each of which contains multiple messages.
Sample request
Copiedcurl "https://mail360.zoho.com/api/accounts/x7**0s/messages" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken 802**74d5ac77" \
-d '{
"mode" :"setFlag",
"messageId":"[164522103243001,16452210000001]",
"flagid":"info"
}'
Sample Success Response
Copied{
"status": {
"code": 200,
"description": "success"
}
}
Sample Failure Response
Copied{
"status": {
"code": 500,
"description": "Internal Error"
},
"data": {
"moreInfo": "Internal Error"
}
}