This Choreo retrieves a specific draft from a user's mailbox. The documentation for this Gmail resource can be found here.
The optional Format input can be passed to request variations in the response that your application may need. The default value of this input is "full", which returns the parsed email message content in the payload field. When set to "minimal", only email message metadata such as identifiers and labels is returned. When set to "raw", the entire email message content is returned as a Base64 encoded string in the raw field. This includes the identifiers, labels, metadata, MIME structure, and small body parts
Note: this method requires that you request one of the following scopes during the OAuth process:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.readonly
The Fields input can be used to reduce the number of fields returned in the response. The syntax for using this parameter is loosely based on XPath. Below are some points to remember when using this input:
- Fields should be separated by commas.
- When fields are nested within other fields, you can refer to them using a path (i.e. urls/value).
- Specify field sub-selectors to request only specific sub-fields by using parentheses "( )" after any selected field.
Here is an example of acceptable inputs:
ClientID: {YOUR CLIENT ID}
ClientSecret: {YOUR CLIENT SECRET}
RefreshToken: {YOUR REFRESH TOKEN}
DraftID: 1474361082775554945
The following is a sample of the JSON information returned by this Choreo:
{
"id": "1474361082775554945",
"message": {
"id": "1475fb99b9d176de",
"threadId": "1475fb99b9d176de",
"labelIds": [
"DRAFT"
],
"snippet": "this is a test -- Aaron Jennings | Temboo | 104 Franklin Street NYC | www.temboo.com",
"historyId": "3843918",
"payload": {
"mimeType": "multipart/alternative",
"filename": "",
"headers": [
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Received",
"value": "by 10.140.27.162 with HTTP; Tue, 22 Jul 2014 13:18:24 -0700 (PDT)"
},
{
"name": "To",
"value": "Aaron Jennings <aaron.jennings@temboo.com>"
},
{
"name": "Date",
"value": "Tue, 22 Jul 2014 16:18:24 -0400"
},
{
"name": "Message-ID",
"value": "<CAEqmo6_5_KDLT3tJ-o=Pb=bRN-crvb+Op603sVmHJGzXb4T2Uw@mail.gmail.com>"
},
{
"name": "Subject",
"value": "test draft"
},
{
"name": "From",
"value": "Aaron Jennings <aaron.jennings@temboo.com>"
},
{
"name": "Content-Type",
"value": "multipart/alternative; boundary=001a1138040402227004fecdedee"
}
],
"body": {
"size": 0
},
"parts": [
{
"partId": "0",
"mimeType": "text/plain",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/plain; charset=UTF-8"
}
],
"body": {
"size": 91,
"data": "dGhpcyBpcyBhIHRlc3QNCg0KLS0gDQpBYXJvbiBKZW5uaW5ncyB8IFRlbWJvbyB8IDEwNCBGcmFua2xpbiBTdHJlZXQgTllDIHwgd3d3LnRlbWJvby5jb20NCg=="
}
},
{
"partId": "1",
"mimeType": "text/html",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/html; charset=UTF-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "quoted-printable"
}
],
"body": {
"size": 254,
"data": "PGRpdiBkaXI9Imx0ciI-dGhpcyBpcyBhIHRlc3Q8YnIgY2xlYXI9ImFsbCI-PGRpdj48YnI-PC9kaXY-LS0gPGJyPjxkaXYgZGlyPSJsdHIiPkFhcm9uIEplbm5pbmdzIHzCoFRlbWJvbyB8IDEwNCBGcmFua2xpbiBTdHJlZXQgTllDIHzCoDxhIGhyZWY9Imh0dHA6Ly93d3cudGVtYm9vLmNvbS8iIHN0eWxlPSJjb2xvcjpyZ2IoMTcsODUsMjA0KSIgdGFyZ2V0PSJfYmxhbmsiPnd3dy50ZW1ib28uY29tPC9hPjxicj4NCjwvZGl2Pg0KPC9kaXY-DQo="
}
}
]
},
"sizeEstimate": 1018
}
}