get_deleted_messages
The get_deleted_messages method retrieves a list of recoverable deleted email messages belonging to a user.
After they are deleted, email messages are retained for a period of time and may be recovered. This method returns a list of recoverable messages, including the message headers, so that a user can select which messages they want recovered.
Syntax
{
   <credentials object>,
   "user": <mailbox_name>, 
   "folder": <folder name>, 
   "headers": [<list of headers>]
}Request fields for get_deleted_messages
The following fields can be used in the get_deleted_messages method:
Field name  | Obligation  | Definition/Value  | 
|---|---|---|
folder  | Optional  | Name of the folder to search. You can specify deleted as well as current folders. If not specified, messages in all folders will be returned.  | 
headers  | Optional  | Specify the headers that you want returned. For a list of the available headers, see Response fields  | 
user  | Required  | The user whose deleted messages you want to list.  | 
Response fields for get_deleted_messages
The following fields may be returned in response to the get_deleted_messages method:
Field name  | Obligation  | Description/Value  | 
|---|---|---|
count  | Returned if success = true  | The number of messages that can be restored.  | 
error  | Returned if success = false  | A text string that explains the error.  | 
error_number  | Returned if success = false  | A number that represents the error.  | 
messages  | Returned if success = true  | A list of the messages that can be recovered. For each message listed, the following information is returned: 
  | 
success  | Always returned  | Indicates whether the request was successful or not. Allowed values are true and false.  | 
Examples for get_deleted_messages
Example 1
Retrieves deleted recoverable messages for [email protected].
Request
{
  "credentials": {
    "user": "[email protected]", 
    "password": "sw0rdf1sh"
  },
  "user": "[email protected]",
}Response
{
  "success": true,
  "count": 6
  "messages": [
    {
      "headers": {
        "return-path": [
          "[email protected]"
				], 
        "date": [
          "Mon, 21 Nov 2011 21:14:50 +0000 (GMT)"
        ],
        "x-mailer": [
          "Webmail"
        ],
        "INTERNALDATE": [
          1321910752
        ],
        "content-type": [
          "text/html; charset=UTF-8"
				], 
				"to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.198]"
				], 
				"from": [
          "June User <[email protected]>"
        ],
        "mime-version": [
          "1.0" 
        ],
        "received": [
					
          "from smtprelay.dev.hostedemail.com (mail.dev.hostedemail.com [216.40.41.197]) by imf16.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 21:14:51 +0000 (UTC)",
					"from filter.hostedemail.com (ff-bigip5 [10.5.49.254]) by smtprelay01.dev.hostedemail.com (Postfix) with SMTP id 54A4919063B for <[email protected]>; Mon, 21 Nov 2011 21:14:51 +0000 (UTC)",
					"from webmail01 (imap-ext [216.40.41.197])",
					"from 10.0.63.198 ([10.0.63.198]) by webmail01 (Webmail) with 
HTTP; Mon, 21 Nov 2011 21:14:50 +0000 (GMT)"
        ],
        "x-spam-summary": [
        
        "39,2.407,0,b00953cdef69ad05,d41d8cd98f00b204,june_user@examp le.com,[email protected],RULES_HIT:152:355:375:379:413:541:582:588:5 89:988:989:1152:1224:1260:1261:1311:1313:1314:1345:1437:1515:1516:1517: 1529:1534:1536:1569:1593:1594:1676:1699:1711:1714:1730:1747:1766:1792:2 393:2557:2559:2562:3138:3769:3865:3870:5007:6261:10004:10400:11658:1191 4,0,RBL:216.40.41.197:@wxample.com:.lbl8.mailshell.net-64.201.201.201 62.10.55.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCach e:0,MSF:not bulk,SPF:ft,MSBL:none,DNSBL:none,Custom_rules:0:0:0"
        
        ],
        "delivered-to": [
          "[email protected]
        ],
        "x-fda": [
          "65578185624.06"
        ],
        "subject": [
          "IMPORTANT!! Please read!!!"
        ],
        "\t(authenticated sender": [
"[email protected]) by omf01.dev.hostedemail.com 
(Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 
21:14:51 +0000 (UTC)"
        ],
        "x-filterd-recvd-size": [
					"1260",
				"748" 
        ],
        "x-session-marker": [ "6A756E655F757365724064656D6F636F2E636F6D"
        ],
        "x-panda": [
					"scanned!",
          "scanned!"
        ],
        "content-transfer-encoding": [
          "7bit"
        ],
        "message-id": [
					"<507672317.5.1321910091140.JavaMail.mail@webmail01>"
				]
			},
      "folder-unicode": "INBOX",
			"id": "U2FsdGVkX18rWbWomiloZWQML6UX9qBBsIn38D3Pzuimm3JW5Q4XC1xTdfHj5XEK0Zz2Dc 8VYUMrESVnn0LfaesVN/y34oTjmX0whWuqoSka5xhAE3ieCEDeDeKRR7m2ghBIBMGV9SNlr 7ORikncOl+cXabSVJyFnnsLysVuaxVX5WKctcDZZAd3YxRhp921",
   		"folder": "INBOX"
    },
    {
      "headers": {
        "return-path": [
          "[email protected]"
        ], 
        "date": [
          "Mon, 21 Nov 2011 21:16:36 +0000 (GMT)"
        ],
        "x-mailer": [
          "Webmail"
        ],
        "INTERNALDATE": [
          1321910752
        ],
        "content-type": [
          "text/html; charset=UTF-8"
        ],
        "to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.198]"
        ],
        "from": [
          "Manager <[email protected]>"
        ],
        "mime-version": [
					"1.0" 
        ],
        "received": [
        
        	"from smtprelay.dev.hostedemail.com (mail.dev.hostedemail.com [216.40.41.197]) by imf27.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 21:16:37 +0000 (UTC)",
          
          "from filter.hostedemail.com (ff-bigip5 [10.5.49.254]) by smtprelay01.dev.hostedemail.com (Postfix) with SMTP id A209819063B for <[email protected]>; Mon, 21 Nov 2011 21:16:37 +0000 (UTC)",
					"from webmail01 (imap-ext [216.40.41.197])",
          
          "from 10.0.63.198 ([10.0.63.198]) by webmail01 (Webmail) with HTTP; 			  Mon, 21 Nov 2011 21:16:36 +0000 (GMT)"   
        ],
        "x-spam-summary": [
          "1,0,0,565f950133a813c6,d41d8cd98f00b204,[email protected] m,[email protected],RULES_HIT:152:355:375:379:541:582:988:989:1152:1 224:1260:1261:1311:1313:1314:1345:1373:1515:1516:1517:1525:1534:1536:15 69:1593:1594:1676:1699:1711:1714:1730:1747:1766:1792:2393:2557:2559:256 2:3138:3769:3876:3877:5007:6114:6261:7901:10004:10400:11658:11914,0,RBL :216.40.41.197:@example.com:.lbl8.mailshell.net-64.201.201.201 62.10.55.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCach e:0,MSF:not bulk,SPF:ft,MSBL:none,DNSBL:none,Custom_rules:0:0:0"
        ],
        "delivered-to": [
          "[email protected]"
        ],
        "x-fda": [
          "65578190076.03"
        ],
        "subject": [
					"Please file your end of quarter reports by end of quarter"
        ],
        "\t(authenticated sender": [
          "[email protected]) by omf01.dev.hostedemail.com 
(Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 
21:16:37 +0000 (UTC)"
          ],
          "x-filterd-recvd-size": [
						"1266",
						"754" 
          ],
					"x-session-marker": [ 
          	"6D726D616E616765724064656D6F636F2E636F6D"
        ],
        "x-panda": [
					"scanned!",
          "scanned!"
        ],
        "content-transfer-encoding": [
          "7bit"
        ],
        "message-id": [
					"<1371513603.7.1321910197378.JavaMail.mail@webmail01>" 
        ]
		},
      "folder-unicode": "INBOX",
			"id":
"U2FsdGVkX1+MQJC6Usm5VuOm34dPzFZgt2Emm1SU0Tj0uWUDbjzvEQUd/f+KKcMzMxZBbN 0zYwr7sXXV7buH0YdndTvu2+/Xg4gR1Fpitn6HUHLyhYnW+3y7brEWCT2a7duvqE7VKHpxA hpCQKjyV+H2gaVzQ/Jfn4LQl6NnfLL0cXU0IFClAkpxHMyABcoZ",
			"folder": "INBOX"
    },
    {
      "headers": {
        "return-path": [
        "[email protected]"
      ],
      "date": [
          "Mon, 21 Nov 2011 21:14:21 +0000 (GMT)"
      ],
      "x-mailer": [
				"Webmail" 
      ],
      "INTERNALDATE": [
          1321910752
        ],
        "content-type": [
					"multipart/mixed; boundary=\"---- 
=_Part_3_280999237.1321910061210\""
				], 
        "to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.198]"
				], 
				"from": [
          "June User <[email protected]>"
        ],
        "mime-version": [
          "1.0"
        ],
        "received": [
					"from smtprelay.dev.hostedemail.com (mail.dev.hostedemail.com [216.40.41.197]) by imf25.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 21:14:24 +0000 (UTC)",
          
          "from filter.hostedemail.com (ff-bigip5 [10.5.49.254]) by smtprelay01.dev.hostedemail.com (Postfix) with SMTP id B447A19063B for <[email protected]>; Mon, 21 Nov 2011 21:14:22 +0000 (UTC)",
          
          "from webmail01 (imap-ext [216.40.41.197])",
          
          "from 10.0.63.198 ([10.0.63.198]) by webmail01 (Webmail) with HTTP; 				Mon, 21 Nov 2011 21:14:21 +0000 (GMT)"
        ],
        "x-spam-summary": [
        	"20,1.5,0,641aaf435ac40a11,d41d8cd98f00b204,june_user@example .com,[email protected],RULES_HIT:152:355:379:541:582:871:929:960:988 :989:1000:1152:1260:1261:1313:1314:1345:1373:1431:1437:1467:1516:1517:1 527:1536:1569:1575:1594:1676:1699:1711:1714:1730:1747:1764:1766:1792:21 94:2197:2199:2200:2375:2376:2393:2559:2562:2827:3138:3653:3867:3869:387 1:3873:4512:4513:4515:6119:6261:6353:6506:7281:7774:7874:7974:8957:9040 :9709:9913:10004:10400:10562:11604:11658:11914:11919:12043,0,RBL:216.40 .41.197:@example.com:.lbl8.mailshell.net-64.201.201.201 62.10.55.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCach e:0,MSF:not bulk,SPF:ft,MSBL:none,DNSBL:none,Custom_rules:0:0:0"
        ],
        "delivered-to": [
          "[email protected]"
        ],
        "x-fda": [
          "65578184490.04"
        ],
        "subject": [
          "Check out this cute pic!"
        ],
        "\t(authenticated sender": [
        	"[email protected]) by omf01.dev.hostedemail.com 
(Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 
21:14:22 +0000 (UTC)"
				],
        "x-filterd-recvd-size": [
					"141147",
					"140632" 
        ],
				"x-session-marker": [ 
        	"6A756E655F757365724064656D6F636F2E636F6D"
        ],
        "x-panda": [
					"scanned!",
          "scanned!"
        ],
				"message-id": [ 
        	"<1001196937.4.1321910062338.JavaMail.mail@webmail01>"
        	] 
        },
        "folder-unicode": "INBOX",
				"id": "U2FsdGVkX19oytJqrlnvKvM0y0E6rbv65exFb6K8fTwgq7PG3ihw0y74AttSiEPCpDic+E Ez4+BkGi7mAXWBqEsIqIfh7zQukN9nlUEoX+T73lLDprLjPHGMFjmgsYHc/MF2F8ufYAQi/ GNy99+iQGQkUPmCTvE4jwpoT/LprjJY87beSHTLqI4KY3g4zJ/u8xNVF3/ywdg=",
      "folder": "INBOX"
    },
    {
      "headers": {
        "return-path": [
          "[email protected]"
				], 
        "date": [
          "Mon, 21 Nov 2011 21:15:24 +0000 (GMT)"
        ],
        "x-mailer": [
          "Webmail"
        ],
        "INTERNALDATE": [
          1321910752
        ],
        "content-type": [
          "text/html; charset=UTF-8"
				], 
        "to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.198]"
				], 
        "from": [
          "June User <[email protected]>"
        ],
        "mime-version": [
        	"1.0"
          ],
        "received": [
				"from smtprelay.dev.hostedemail.com (mail.dev.hostedemail.com [216.40.41.197]) by imf25.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 21:15:26 +0000 (UTC)",
				"from filter.hostedemail.com (ff-bigip5 [10.5.49.254]) by smtprelay01.dev.hostedemail.com (Postfix) with SMTP id AC9CF19063B for <[email protected]>; Mon, 21 Nov 2011 21:15:25 +0000 (UTC)",
				"from webmail01 (imap-ext [216.40.41.197])",
				"from 10.0.63.198 ([10.0.63.198]) by webmail01 (Webmail) with 
HTTP; Mon, 21 Nov 2011 21:15:24 +0000 (GMT)"
				],
        "x-spam-summary": [
          "1,0,0,5058f1af8388633f,d41d8cd98f00b204,[email protected] m,[email protected],RULES_HIT:152:355:375:379:541:582:988:989:1152:1 224:1260:1261:1311:1313:1314:1345:1373:1515:1516:1517:1523:1534:1536:15 69:1593:1594:1676:1699:1711:1714:1730:1747:1766:1792:2393:2559:2562:313 8:3876:3877:5007:6114:6261:10004:10400:11658:11914,0,RBL:216.40.41.197: @example.com:.lbl8.mailshell.net-64.201.201.201 62.8.55.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache :0,MSF:not bulk,SPF:fn,MSBL:none,DNSBL:none,Custom_rules:0:0:0"
        ],
        "delivered-to": [
          "[email protected]"
        ],
        "x-fda": [
          "65578187052.05"
        ],
        "subject": [
          "Have you signed up for the Spring Party yet?"
        ],
        "\t(authenticated sender": [
					"[email protected]) by omf01.dev.hostedemail.com 
(Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 
21:15:25 +0000 (UTC)"
				],
        "x-filterd-recvd-size": [
					"1233",
					"721" 
        ],
        "x-session-marker": [ 
        	"6A756E655F757365724064656D6F636F2E636F6D"
				],
				"x-panda": [
					"scanned!",
  				"scanned!"
				],
				"content-transfer-encoding": [
  				"7bit"
				],
				"message-id": [
					"<1436882877.6.1321910125526.JavaMail.mail@webmail01>" 
        ]
			},
      "folder-unicode": "INBOX",
			"id": "U2FsdGVkX1+cUef21BEodmVA2lgDHINRlgKL8VnxpMcr3McPwNr9ifXtXCekoSn1AdEZW4 eoNS77iHJ4tdv8by/CgqDSdNqDS+cATjXbXEkxR2kcr63X7+1d/4xOM0ldmbcSJ0DcZas3F ipc9aJdAMwUxqUyPfhiFHFnhGAmBoy7S8KKHkS/2TxQ9Ic50XX7",
"folder": "INBOX"
		},
    {
      "headers": {
        "date": [
          "Tue, 22 Nov 2011 19:00:56 +0000 (GMT)"
        ],
        "subject": [
          "Re: Banannanannananananana"
        ],
        "x-mailer": [
          "Webmail"
        ],
        "content-transfer-encoding": [
					"7bit" 
        ],
        "INTERNALDATE": [
          1321988456
        ],
        "content-type": [
          "text/html; charset=UTF-8"
				], 
        "to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.197]"
				], 
        "cc": [
          "[email protected], [email protected], [email protected], [email protected], [email protected]"
        ],
        "references": [
					"<1968605354.270.1321988431729.JavaMail.mail@webmail01>" 
        ],
        "from": [
          "Joseph User <[email protected]>"
        ],
        "mime-version": [
					"1.0" ],
        "received": [
					"from 10.0.63.197 ([10.0.63.197]) by webmail01 (Webmail) with 
 HTTP; Tue, 22 Nov 2011 19:00:56 +0000 (GMT)"
        ],
        "message-id": [
					"<2130206675.272.1321988456313.JavaMail.mail@webmail01>" 
        ]
			},
      "folder-unicode": "Sent Items",
			"id": "U2FsdGVkX18pR0nXIwiJ34Pi7tCBsFdZQ+hna2Hb5yEf1iegElKHugPC1MZJgvS6ADSJE2 CJMrRA9WC+8ULKL+/z5eX4GWH0qG5j3TZKRQQcFLCDYQs1RATePrCzKRye2PBz8CPJEnB+o HyLS4aexStXKq8UVs5tDPHW+fxAWlALhZrQpnzBw5SVknqvkJhQIxE6GZBwGBQ=",
      "folder": "Sent Items"
    },
    {
      "headers": {
        "return-path": [
          "[email protected]"
				], 
        "date": [
          "Mon, 21 Nov 2011 21:14:21 +0000 (GMT)"
        ],
        "x-mailer": [
          "Webmail"
        ],
        "INTERNALDATE": [
          1321910752
        ],
        "content-type": [
					"multipart/mixed; boundary=\"---- 
=_Part_3_280999237.1321910061210\""
				], "to": [
          "[email protected]"
        ],
        "x-originating-ip": [
          "[10.0.63.198]"
				], "from": [
          "June User <[email protected]>"
        "mime-version": [
					"1.0" ],
        "received": [
					"from smtprelay.dev.hostedemail.com (mail.dev.hostedemail.com [216.40.41.197]) by imf25.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 21:14:24 +0000 (UTC)",
          "from filter.hostedemail.com (ff-bigip5 [10.5.49.254]) by smtprelay01.dev.hostedemail.com (Postfix) with SMTP id B447A19063B for <[email protected]>; Mon, 21 Nov 2011 21:14:22 +0000 (UTC)",
				"from webmail01 (imap-ext [216.40.41.197])",
				"from 10.0.63.198 ([10.0.63.198]) by webmail01 (Webmail) with 
HTTP; Mon, 21 Nov 2011 21:14:21 +0000 (GMT)"
        ],
        "x-spam-summary": [
          "20,1.5,0,641aaf435ac40a11,d41d8cd98f00b204,june_user@example .com,[email protected],RULES_HIT:152:355:379:541:582:871:929:960:988 :989:1000:1152:1260:1261:1313:1314:1345:1373:1431:1437:1467:1516:1517:1 527:1536:1569:1575:1594:1676:1699:1711:1714:1730:1747:1764:1766:1792:21 94:2197:2199:2200:2375:2376:2393:2559:2562:2827:3138:3653:3867:3869:387 1:3873:4512:4513:4515:6119:6261:6353:6506:7281:7774:7874:7974:8957:9040 :9709:9913:10004:10400:10562:11604:11658:11914:11919:12043,0,RBL:216.40 .41.197:@example.com:.lbl8.mailshell.net-64.201.201.201 62.10.55.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCach e:0,MSF:not bulk,SPF:ft,MSBL:none,DNSBL:none,Custom_rules:0:0:0"
          ],
        "delivered-to": [
          "[email protected]"
        ],
        "x-fda": [
          "65578184490.04"
        ],
        "subject": [
          "Check out this cute pic!"
        ],
        "\t(authenticated sender": [
					"[email protected]) by omf01.dev.hostedemail.com 
(Postfix) with ESMTP for <[email protected]>; Mon, 21 Nov 2011 
21:14:22 +0000 (UTC)"
        ],
        "x-filterd-recvd-size": [
					"141147",
					"140632" 
        ],
				"x-session-marker": [ "6A756E655F757365724064656D6F636F2E636F6D"
        ],
        "x-panda": [
        	"scanned!",
          "scanned!"
        ],
				"message-id": [ 
        	"<1001196937.4.1321910062338.JavaMail.mail@webmail01>"
				] 
			},
      "folder-unicode": "plus ça change",
      "id": "U2FsdGVkX1+FRyKE8mqxWO7BCySwid3bBxSx8Yy0ro+Ss/1n5PIdD/jylUTBhjAbxzItec P5yCwChiZKxZyQ1n9bcicRxAWh7Cr6FYCV80y1w9BjpJoJxPdo9sa/jbUvQnGdbKGzaTqgR VqcFFfhcgM7/WBFFfc6gEBe+apdt602KqtHBBnACis3FWL0LJq6hXGDhTF2wg2QWJzrbG2q BW6nAkfduj2z",
      "folder": "plus &AOc-a change"
    }
  ], 
}Example 2
Retrieves messages with specific headers.
Request
{
  "credentials": {
    "user": "[email protected]",
    "password": "pencil75"
  },
  "user": "[email protected]",
  "headers": [
    "subject",
    "from" 
  ]
}Response
{
  "success": true,
  "count": 3
  "messages": [
    {
      "headers": {
        "INTERNALDATE": [
          1321910752
        ],
        "from": [
          "June User <[email protected]>"
        ],
        "subject": [
          "IMPORTANT!! Please read!!!"
        ]
			},
      "folder-unicode": "INBOX",
      "id": "U2FsdGVkX1+OFA3m95RbsYdxH4EFoUGa2DUr8Zg+G+8hvH53T/RzR6hEBwIGfrSkfNadTQ TR2nb/OsRk9oBp01+/oUYKciim5sU1SI/k2uMed2tgyZtH7W4SY3UBMa17I+FQYGx/owSvx gjrYZHZQkiExpah6x5YaKqkkpH5CmXLKHvWGHjZNF28agK0KP0V",
      "folder": "INBOX"
    },
    {
      "headers": {
        "INTERNALDATE": [
          1321910752
			], 
      "from": [
         "June User <[email protected]>"
      ],
      "subject": [
          "Have you signed up for the Spring Party yet?"
			] 
    },
    "folder-unicode": "INBOX",
		"id":
"U2FsdGVkX1+T0SHk/WSnTKkpVxHwTwtmJlz2mAf+bk8itlX7tHnbIJfi40EO5siFsOj98f Sz/qXdr/dQzvOrYs4fQpl0Juo76TQrKDfb1EGuYO79Rw2smAWA57DHKzizgbvEOdiBkSE9z f/HnZnh8hgTV4vQ8eYJ6JYza9PGbQ2c/Ox0TiY6Yb8yN/HmKURj",
		  "folder": "INBOX"
      }, 
      {
			"headers": {
  			"INTERNALDATE": [
    			1321910752
  			],
  			"from": [
    			"Manager <[email protected]>"
  			],
  			"subject": [
					"Please file your end of quarter reports by end of quarter" 
        ]
			},
      "folder-unicode": "INBOX",
      "id": "U2FsdGVkX1+TadnPrnXWEz0gB2x1rcV6ZrlND3+U4gnpAkXGh6LiT0E9L6GLDgNq85Vf/r XJ6Ka1l1DsfPT4qChnyV+9uqbJSRWzZC26h2Ajg+RK+lObcn6f23Cfyj+8sqQz07ikmfI4t vVl5RImJjC7QPthdtYmxcbRhH+fjVPcOz/RbknRhcz/KeDJsYiD",
       "folder": "INBOX"
    }
	], 
}Updated 7 months ago
