Label Threads

Purpose

This API is used to apply single/multiple labels to single or multiple threads simultaneously.

OAuth Scope

Use the scope

MailApps.messages.ALL (or) MailApps.messages.UPDATE

ALL - Full access to the messages.

UPDATE - Label threads.

To generate Authtoken, refer here.

Request URL

Method: PUT

https://mail360.zoho.com/api/accounts/{account_key}/threads

Path Parameters

  • account_key* string
    • This key is used to identify the account in which the threads have to be updated. It is generated during account addition.

Request Body (JSON Object)

  • mode* string
    • This parameter represents the type of operation that is to be performed.
    • Provide the value as applyLabel.
  • threadId* JSON Array of long
    • This parameter needs to be passed as an array of single or multiple thread IDs which has to be labelled.
    • threadId is a unique identifier assigned to a thread.
  • labelId* JSON Array of long
    • This parameter needs to be passed as an array of single or multiple label IDs which has to be applied.
    • labelId is a unique identifier assigned to a label.

 

* - 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/N7A**0CM/threads" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \
-d '{
  "mode" :"applyLabel",
  "threadId":"[164522103243001,16452210000001]",
  "labelId":"[16452210,16452212]"
}'

Sample Success Response

Copied{
   "status": {
       "code": 200,
       "description": "success"
   }
}

Sample Failure Response

Copied{
   "status": {
       "code": 500,
       "description": "Internal Error"
   },
   "data": {
       "moreInfo": "Internal Error"
   }
}