Get All Drafts

Purpose

This API is used to retrieve and list all the drafts in the specified account.

OAuth Scope

Use the scope

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

ALL - Full access to the messages.

READ - Read all draft.

To generate Authtoken, refer here.

Request URL

Method: GET

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

Path Parameters

  • account_key* string
    • This is a unique key used to identify the account from which drafts will be retrieved. It is generated during account addition.
    • This parameter can be fetched using the Get All Accounts API.

Query Parameters

  • start int
    • This parameter specifies the starting sequence number of the drafts to be retrieved.
    • The default value is 0.
  • limit int
    • This parameter specifies the number of drafts to be retrieved from the start value mentioned.
    • The value can be between 1 to 100.
    • The default value is 25.
  • sortorder boolean
    • This parameter specifies the sort order of the retrieved list, allowing you to indicate whether ascending or descending order is required.
    • The value can be 
      • true, for ascending order 
      • false, for descending order
    • The default value is false.
  • sortBy string
    • This parameter specifies on which basis the sorting of the list of emails should be done.
    • The values can be 
      • date 
      • messageId 
      • size
    • The default value is date.

 

* - Mandatory parameter

Sample Request

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

Sample Response

Copied{
   "status": {
      "code": 200,
      "description": "success"
   },
   "data": [
      {
         "fromAddress": "rebecca1@zylker.com",
         "toAddress": "<rebecca2@zylker.com>",
         "ccAddress": "<paula@zylker.com>",
         "bccAddress": "<paula2@zylker.com>",
         "draftId": "1674571936262110001",
         "folderId": "23450000000003003",
         "sender": "rebecca1@zylker.com",
         "summary": "",
         "status": "1",
         "subject": "new Mail testing",
         "size": "293",
         "receivedTime": "1674572433997",
         "sentDateInGMT": "1674552633000",
         "flagid": "flag_not_set",
         "hasAttachment": 0
      },
      {
         "fromAddress": "rebecca1@zylker.com",
         "ccAddress": "Not Provided",
         "draftId": "1674561051116110001",
         "folderId": "23450000000003003",
         "sender": "rebecca1",
         "summary": "testing draft",
         "status": "1",
         "subject": "test",
         "size": "240",
         "receivedTime": "1657717062000",
         "sentDateInGMT": "1657697262000",
         "flagid": "flag_not_set",
         "hasAttachment": 0
      }
   ]
}