Get a Specific Thread

Purpose

This API is used to retrieve a specific thread in an account.

OAuth Scope

Use the scope

MailApps.messages.ALL (or) MailApps.messages.READ

ALL - Full access to the messages.

READ - Read a thread.

To generate Authtoken, refer here.

Request URL

Method: GET

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

Path Parameters

  • account_key* string
    • This key is used to identify the account from which the threads have to be retrieved. It is generated during account addition.
    • This parameter can be fetched using the Get All Accounts API.
  • threadId* long
    • This is the unique key to identifying a specific thread in an account.
    • This parameter be fetched using the Get All Threads API.

Query Parameters

  • start int
    • This parameter specifies the starting sequence number of the emails to be retrieved.
    • The default value is 0.
  • limit int
    • This parameter specifies the number of emails to be retrieved from the start value mentioned.
    • The value can be between 1 to 200.
    • The default value is 25.
  • folderId long
    • Provide the folder ID to fetch emails only from that particular folder.
    • The default value is null.
  • flagId string
    • This parameter is passed to retrieve emails based on the specific flag.
    • The possible value can be
      • info
      • important
      • followup
      • flag_not_set
    • The default value is flag_not_set.
  • labelId long
    • This parameter is passed to retrieve emails based on the specific label.
    • The default value is null.

 

* - Mandatory parameter

Note:

While Messages APIs focus on retrieving individual messages, the Threads APIs are used to retrieve complete conversation threads containing multiple messages.

Sample Request

Copiedcurl "https://mail360.zoho.com/api/accounts/N7A**0CM/threads/167594940852211****" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \

Sample Success Response

Copied{
  "status": {
    "code": 200,
    "description": "success"
  },
  "data": [
    {
      "fromAddress": "mailer-daemon@zylker.com",
      "messageId": "1685340083025110004",
      "folderId": "32961000000002038",
      "sender": "mailer-daemon@zylker.com",
      "summary": "This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. zmimaptesting@zylker.com, ERROR CODE :421 - 4.7.28 [121.244.91.2 15] Our sys",
      "status": "0",
      "subject": "Undelivered Mail Returned to Sender",
      "size": 3640,
      "hasAttachment": 0,
      "threadCount": 0,
      "receivedTime": "1682074399000",
      "toAddress": "<rebecca@zylker.com>",
      "ccAddress": "Not Provided",
      "threadId": "1685340083025110004",
      "sentDateInGMT": "1682054599000",
      "flagid": "flag_not_set"
    },
    {
      "fromAddress": "rebecca@zylker.com",
      "messageId": "1685340087132110038",
      "folderId": "32961000000002044",
      "sender": "rebecca@zylker.com",
      "summary": "",
      "status": "1",
      "subject": "(No Subject)",
      "size": 298,
      "hasAttachment": 0,
      "threadCount": 0,
      "receivedTime": "1682074387000",
      "toAddress": "<testuser1212@zylker.com>",
      "ccAddress": "<zmimaptesting@zylker.com>",
      "threadId": "1685340083025110004",
      "sentDateInGMT": "1682054587000",
      "flagid": "flag_not_set"
    }
  ]
}

Sample Failure Response

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