GET - List of emails in a folder
Purpose
The API retrieves the list of all the emails in a specific folder or the list of emails, based on the predefined conditions like Status/ Flag/ Labels and so on.
Request URL
https://mail.zoho.com/api/accounts/<accountId>/messages/view
Request Parameters
Parameter | Data Type | Description |
accountID* | Long | The unique Zoho Account number associated with the particular account. |
Request Body
Parameter | Data Type | Possible Values | Description |
folderId | long | - | Folder Id of the folder for which the emails need to be retrieved. |
start | int | - | The start sequence number of the emails to be retrieved, to retrieve a specific set of emails. The default value is 1. |
limit | int | 1 - 200 | The number of emails to be retrieved from the start value mentioned. The default value is 10. |
status | string | unread; read | To retrieve emails by read or unread status. |
flagid | Integer | - | To retrieve emails based on a specific flag. |
labelid | long | - | To retrieve emails based on a specific label. |
sortBy | string | date, messageId, size | The list of emails can be sort by date, messageid or size. The default sort order is date. |
sortorder | boolean | true - ascending; fasle - descending | The sort order of the retrieved list, whether ascending or descending need to be specified here. |
includeto | boolean | true - include; false - do not include | Whether the To details need to be included or not. |
includearchive | boolean | true - include; false - do not include | Whether the Archived emails need to be included or not on the list of emails retrieved. |
includesent | boolean | true - include; false - do not include | Whether Sent emails need to be included or not on the list of emails retrieved. |
fields | string | - | The list of fields that need to included in the retrieved list or not. |
attachedMails | boolean | true - emails with attachments; false - all emails | To retrieve only the emails with attachments. |
inlinedMails | boolean | true - emails with inlines; false - all emails | To retrieve only the emails with inlines. |
flaggedMails | boolean | true - emails with flags; false - all emails | To retrieve only flagged emails. |
respondedMails | boolean | true - emails with replies; false - all emails | To retrieve only replied emails. |
threadedMails | boolean | true - emails that are conversations; false - all emails | To retrieve emails that are a part of conversations. |
* - Mandatory parameter
Response Parameters
Parameter | Data Type | Possible Values | Description |
hasAttachment | boolean | 0 - fasle; 1 - true | Whether the email has an attachment or not |
fromAddress | email address | senderdame@domainname.com | The email address from which the email is sent |
folderId | int | - | Folder id in which the emails are present |
messageId | int | - | The unique id associated with each email |
sender | string | - | The username of the email sender |
summary | string | - | The summary of the email dispalyed in the email listing |
status2 | int | 0 - default; 1 - replied; 2 - forward; 3 - replayandforwarded | If the email has been replied to, forwarded or replied to and forwarded |
sentDateinGMT | long | - | The date when the email has been sent |
size | int | - | The size of the email |
status | int | 0 - unread; 1- read | The read or unread state of the email |
priority | int | 1 - highest; 2 - High; 3 - Normal; 4 - low; 5 - lowest | The priority set for the email |
threadCount | int | - | The number of emails that are part of this conversation |
flagid | string | flag_not_set; info; important; followup | The identifier for the flag that has been set |
subject | string | - | The subject of the email |
threadId | long int | - | The id for the thread tthat |
receivedtime | long | - | The time when the email was received |
Response Codes
Please refer Response Codes.
Refer to email API for other mailing options using the API.
Sample Response
Copied{
"status": {
"code": 200,
"description": "success"
},
"data": [
{
"URI": "https://mail.zoho.com/api/accounts/9000000000993/folders/9000000000905/messages/9000000010029",
"hasAttachment": 0,
"fromAddress": "mysenders@otherzoho.com",
"folderId": 9000000000305,
"messageId": 9000000019029,
"sender": "Daniel Bond",
"summary": "We are happy to welcome you onboard",
"status2": "1",
"sentDateInGMT": 1270171976000,
"size": 540,
"status": "0",
"priority": 3,
"threadCount": 0,
"flagid": flag_not_set,
"subject": "Great to see you",
"threadId": 1,
"receivedtime": 1425388373920
},
{
"URI": "https://mail.zoho.com/api/accounts/9000000000993/folders/9000000000905/messages/9000000019022",
"hasAttachment": 0,
"fromAddress": "mysenders@othermail.com",
"folderId": 9000000000905,
"messageId": 9000000019022,
"sender": "Elizabeth Salma",
"summary": "A great opportunity to meet you all",
"status2": "1",
"sentDateInGMT": 1270171976000,
"size": 540,
"status": "0",
"priority": 3,
"flagid": flag_not_set,
"subject": "Hey there",
"threadId": 0,
"receivedtime": 1425388373741
},
{
"URI": "https://mail.zoho.com/api/accounts/9000000000299/folders/9000000000905/messages/9000000019020",
"hasAttachment": 0,
"fromAddress": "mymanager@mydomain.com",
"folderId": 9000000000905,
"messageId": 9000000019020,
"sender": "Rajiv",
"summary": "Can you send the status of the last order ",
"status2": "1",
"sentDateInGMT": 1270171976000,
"size": 540,
"status": "0",
"priority": 3,
"flagid": 2,
"subject": "Status Report",
"threadId": 0,
"receivedtime": 1425388373581
}
]
}