gmail.users.drafts.list

GET {{baseUrl}}/gmail/v1/users/:userId/drafts?includeSpamTrash=<boolean>&maxResults=<integer>&pageToken=<string>&q=<string>&$.xgafv=<string>&access_token=<string>&alt=<string>&callback=<string>&fields=<string>&key=<string>&oauth_token=<string>&prettyPrint=<boolean>&quotaUser=<string>&upload_protocol=<string>&uploadType=<string>

Lists the drafts in the user's mailbox.

Request Params

KeyDatatypeRequiredDescription
includeSpamTrashstringInclude drafts from SPAM and TRASH in the results.
maxResultsstringMaximum number of drafts to return.
pageTokenstringPage token to retrieve a specific page of results in the list.
qstringOnly return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, &quot;from:someuser@example.com rfc822msgid: is:unread&quot;.
$.xgafvstringV1 error format.
access_tokenstringOAuth access token.
altstringData format for response.
callbackstringJSONP
fieldsstringSelector specifying which fields to include in a partial response.
keystringAPI key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
oauth_tokenstringOAuth 2.0 token for the current user.
prettyPrintstringReturns response with indentations and line breaks.
quotaUserstringAvailable to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
upload_protocolstringUpload protocol for media (e.g. "raw", "multipart").
uploadTypestringLegacy upload protocol for media (e.g. "media", "multipart").

RESPONSES

status: OK

{&quot;drafts&quot;:[{&quot;id&quot;:&quot;veniam Duis exercitati&quot;,&quot;message&quot;:{&quot;historyId&quot;:&quot;dolore sint Excepteur ipsum reprehenderit&quot;,&quot;id&quot;:&quot;minim et dolore&quot;,&quot;internalDate&quot;:&quot;proident Excepteur&quot;,&quot;labelIds&quot;:[&quot;irure dolore fugiat aliquip eiusmod&quot;,&quot;do sint laboris occaecat&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;laborum&quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;labore Excepteur&quot;,&quot;partId&quot;:&quot;anim eu tempor velit&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;aute qui&quot;,&quot;sizeEstimate&quot;:-56161869,&quot;snippet&quot;:&quot;consectetur occaecat irure elit&quot;,&quot;threadId&quot;:&quot;ex eu proident in magna&quot;}},{&quot;id&quot;:&quot;elit Duis dolore&quot;,&quot;message&quot;:{&quot;historyId&quot;:&quot;ut&quot;,&quot;id&quot;:&quot;deserunt laborum&quot;,&quot;internalDate&quot;:&quot;mollit minim&quot;,&quot;labelIds&quot;:[&quot;cillum laboris&quot;,&quot;do velit magna aute laboris&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;aute Lorem sed irure&quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;ullamco i&quot;,&quot;partId&quot;:&quot;nisi laboris sunt&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;&quot;,&quot;sizeEstimate&quot;:-54111262,&quot;snippet&quot;:&quot;id quis in do&quot;,&quot;threadId&quot;:&quot;pariatur ut Excep&quot;}}],&quot;nextPageToken&quot;:&quot;in aliquip culpa&quot;,&quot;resultSizeEstimate&quot;:99349769}