- API reference
- Drafts
- Return a Draft
https://api.us.nylas.com/v3/grants/{grant_id}/drafts/{draft_id}Return a Draft
Return a draft by ID.
Path parameters
ID of the grant to access. Use /me/ to refer to the grant associated with an access token.
ID of the draft to access. Nylas recommends you URL-encode this field, or you might receive a
404 error if the ID contains special characters (for
example, #).
Query parameters
Specify fields that you want Nylas to return, as a comma-separated list (for example,
select=id,updated_at). This allows you to receive only the portion of object data that you're
interested in. You can use select to optimize response size and reduce latency by limiting queries
to only the information that you need.
bodystringThe body of the draft as either plain-text or HTML content. If the draft has both plain-text and HTML, Nylas returns the HTML version.
"Hi, Welcome to Nylas!"attachmentsarray<object>An array of Attachment objects. For Google, linked Google Drive files are not included. For Microsoft, linked One Drive files are not included.
[{"content_disposition":"attachment","content_type":"text/calendar","id":"4kj2jrcoj9ve5j9yxqz5cuv98","size":1708},{"content_disposition":"attachment","content_type":"application/ics","filename":"invite.ics","id":"70jcsv367jaiavt4njeu4xswg","size":1708}]content_typestringThe MIME type of the attachment, used by the email client to determine how to display the attachment. If you don't provide a type, Nylas infers it from the file name.
The value of this field is exactly the same as the email attachment's Content-Type header.
The provider might set additional parameters, such as name and charset.
Nylas returns an empty content_type field if an attachment file name contains non-ASCII characters (for example, accented characters like ü). This is because Google can't detect its content type.
"image/png; name=\"pic.png\"""41009df5-bf11-4c97-aa18-b285b5f2e386"content_idstring(Inline attachments only) The alphanumeric cid from the <img> tag in the message's HTML. For
example, you might see something like <img src=\"cid:ce9b9547-9eeb-43b2-ac4e-58768bdf04e4\"> in
the message body.
Sometimes, the content_id value is contained in angle brackets (for example,
<ce9b9547-9eeb-43b2-ac4e-58768bdf04e4>).
"ce9b9547-9eeb-43b2-ac4e-58768bdf04e4"foldersarray<string>A list of folder IDs. For Microsoft, only a single folder is supported. For Google, multiple folders may exist.
["8l6c4d11y1p4dm4fxj52whyr9","d9zkcr2tljpu3m4qpj7l2hbr0"][{"email":"[email protected]","name":""}]"41009df5-bf11-4c97-aa18-b285b5f2e386"idstringA globally unique object identifier for Microsoft accounts. An email address for Google accounts.
"5d3qmne77v32r8l4phyuksl2x, [email protected]"reply_toarray<object>An array of name/email address pairs that should receive replies to the message.
[{"email":"[email protected]","name":""}]snippetstringA short snippet of the message body (the first 100 characters, with any HTML tags removed). This is useful for displaying a preview of a draft message.
"You have been invited to the following event. Welcome! WhenThu Oct 28, 2021 7am - 8am Eastern\nTime - Toronto Joining info"starredbooleanWhen true, shows that the Draft has been starred by the user. For EWS, this is only supported
for Microsoft Exchange 2010 or later.
false"Invitation: Welcome! @ Thu Oct 28, 2021 7am - 8am (EDT) - Toronto"thread_idstringA reference to the parent Thread object. If this is a new draft, the thread is empty.
"1t8tv3890q4vgmwq6pmdwm8qg"[{"email":"[email protected]","name":""},{"email":"[email protected]","name":""}]Rate limited. The provider or Nylas throttled the request. If a provider throttles a request and
says how long to wait, the Retry-After header gives that number of seconds. When the header
is missing, retry with exponential backoff. See
429 rate limit errors by provider.