This Choreo retrieves the latest email from a user's inbox. The documentation for this Gmail resource can be found here.
The optional StartHistoryID input can be passed to request the latest message since the last time your application requested a message. When the Choreo retrieves a message, it will always return a HistoryID that can be used for this purpose.
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.readonly
Here is an example of acceptable inputs:
ClientID: {YOUR CLIENT ID}
ClientSecret: {YOUR CLIENT SECRET}
RefreshToken: {YOUR REFRESH TOKEN}
The following is a sample of the JSON information returned by this Choreo:
{
"id": "1473fa6aca5e0543",
"threadId": "1473fa6aca5e0543",
"labelIds": [
"SENT",
"INBOX",
"UNREAD"
],
"snippet": "this is a test -- Aaron Jennings | Temboo | 104 Franklin Street NYC | www.temboo.com",
"historyId": "3812809",
"payload": {
"mimeType": "multipart/alternative",
"filename": "",
"headers": [
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Received",
"value": "by 10.152.87.42 with HTTP; Wed, 16 Jul 2014 07:49:53 -0700 (PDT)"
},
{
"name": "Date",
"value": "Wed, 16 Jul 2014 10:49:53 -0400"
},
{
"name": "Delivered-To",
"value": "aaron.jennings@temboo.com"
},
{
"name": "Message-ID",
"value": "<CAEqmo6-YNV0FrS0qyfNpxJLWMX3NnewewMX8mkA5jYxFUSFuhw@mail.gmail.com>"
},
{
"name": "Subject",
"value": "test email"
},
{
"name": "From",
"value": "Aaron Jennings <aaron.jennings@temboo.com>"
},
{
"name": "To",
"value": "Aaron Jennings <aaron.jennings@temboo.com>"
},
{
"name": "Content-Type",
"value": "multipart/alternative; boundary=001a11c258b813a03e04fe50a31b"
}
],
"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": 1058
}