Get Started
Usage API
More information

PUT api/2.0/mail/drafts/save This function requires authentication

Description

Saves a message with the ID specified in the request as a draft.

Parameters
Name Description Type Example
id
sent in body
Message ID which will be saved or 0 number 1234
from
sent in body
Mail address from which a letter will be sent. Format: Name <name@domain> string some text
to
sent in body
List of mail addresses to which a letter will be sent. Format: Name <name@domain> Collection of strings some text
cc
sent in body
List of Cc (carbon copy) mail addresses. Format: Name <name@domain> Collection of strings some text
bcc
sent in body
List of Bcc (blind carbon copy) mail addresses. Format: Name <name@domain> Collection of strings some text
mimeReplyToId
sent in body
Message ID to which this message is replying to string some text
importance
sent in body
Specifies if this message is important or not: true - important, false - not important Bool value true
subject
sent in body
Message subject string some text
tags
sent in body
List of tag IDs added to the message System.Collections.Generic.List{System.Int32}
body
sent in body
Message body as the HTML string string some text
attachments
sent in body
List of message attachments System.Collections.Generic.List{ASC.Mail.Data.Contracts.MailAttachmentData}
calendarIcs
sent in body
Calendar event in the iCal format for sending string some text
Example
PUT api/2.0/mail/drafts/save
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "id": 1234,
  "from": "some text",
  "to": [
    "some text"
  ],
  "cc": [
    "some text"
  ],
  "bcc": [
    "some text"
  ],
  "mimeReplyToId": "some text",
  "importance": true,
  "subject": "some text",
  "tags": [
    1234
  ],
  "body": "some text",
  "attachments": [
    {
      "fileId": 1234,
      "fileName": "fileName",
      "size": 1234,
      "contentType": "contentType",
      "needSaveToTemp": true,
      "contentId": "contentId",
      "fileNumber": 333,
      "storedName": "storedName",
      "streamId": "streamId",
      "savedToMyDocuments": true,
      "tempStoredUrl": "tempStoredUrl"
    }
  ],
  "calendarIcs": "some text"
}
Returns

Saved message

Example Response

application/json

{
  "status": 0,
  "response": {
    "Attachments": [
      {
        "fileId": 1234,
        "fileName": "fileName",
        "size": 1234,
        "contentType": "contentType",
        "needSaveToTemp": true,
        "contentId": "contentId",
        "fileNumber": 333,
        "storedName": "storedName",
        "streamId": "streamId",
        "savedToMyDocuments": true,
        "tempStoredUrl": "tempStoredUrl"
      }
    ],
    "Introduction": "Introduction",
    "HtmlBody": "HtmlBody",
    "ContentIsBlocked": true,
    "Important": true,
    "Subject": "Subject",
    "HasAttachments": true,
    "Bcc": "Bcc",
    "Cc": "Cc",
    "To": "To",
    "Address": "Address",
    "From": "From",
    "ReplyTo": "ReplyTo",
    "Id": 555,
    "ChainId": "ChainId",
    "ChainDate": "ChainDate",
    "Date": "Date",
    "DateDisplay": "DateDisplay",
    "TagIds": [
      1234
    ],
    "LabelsInString": "LabelsInString",
    "IsNew": true,
    "IsAnswered": true,
    "IsForwarded": true,
    "TextBodyOnly": true,
    "Size": 555555,
    "EMLLink": "EMLLink",
    "StreamId": "StreamId",
    "RestoreFolderId": 1,
    "Folder": 1,
    "UserFolderId": 144,
    "ChainLength": 144,
    "WasNew": false,
    "IsToday": false,
    "IsYesterday": false,
    "ReceivedDate": "2020-12-18T08:12:09.1209967Z",
    "IsBodyCorrupted": false,
    "HasParseError": false,
    "MimeMessageId": "MimeMessageId",
    "MimeReplyToId": "MimeReplyToId",
    "CalendarUid": "CalendarUid"
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <Attachments>
      <fileId>1234</fileId>
      <fileName>fileName</fileName>
      <size>1234</size>
      <contentType>contentType</contentType>
      <needSaveToTemp>True</needSaveToTemp>
      <contentId>contentId</contentId>
      <fileNumber>333</fileNumber>
      <storedName>storedName</storedName>
      <streamId>streamId</streamId>
      <savedToMyDocuments>True</savedToMyDocuments>
      <tempStoredUrl>tempStoredUrl</tempStoredUrl>
    </Attachments>
    <Introduction>Introduction</Introduction>
    <HtmlBody>HtmlBody</HtmlBody>
    <ContentIsBlocked>True</ContentIsBlocked>
    <Important>True</Important>
    <Subject>Subject</Subject>
    <HasAttachments>True</HasAttachments>
    <Bcc>Bcc</Bcc>
    <Cc>Cc</Cc>
    <To>To</To>
    <Address>Address</Address>
    <From>From</From>
    <ReplyTo>ReplyTo</ReplyTo>
    <Id>555</Id>
    <ChainId>ChainId</ChainId>
    <ChainDate>ChainDate</ChainDate>
    <Date>Date</Date>
    <DateDisplay>DateDisplay</DateDisplay>
    <TagIds>1234</TagIds>
    <LabelsInString>LabelsInString</LabelsInString>
    <IsNew>True</IsNew>
    <IsAnswered>True</IsAnswered>
    <IsForwarded>True</IsForwarded>
    <TextBodyOnly>True</TextBodyOnly>
    <Size>555555</Size>
    <EMLLink>EMLLink</EMLLink>
    <StreamId>StreamId</StreamId>
    <RestoreFolderId>1</RestoreFolderId>
    <Folder>1</Folder>
    <UserFolderId>144</UserFolderId>
    <ChainLength>144</ChainLength>
    <WasNew>False</WasNew>
    <IsToday>False</IsToday>
    <IsYesterday>False</IsYesterday>
    <ReceivedDate>2020-12-18T08:12:09.1209967Z</ReceivedDate>
    <IsBodyCorrupted>False</IsBodyCorrupted>
    <HasParseError>False</HasParseError>
    <MimeMessageId>MimeMessageId</MimeMessageId>
    <MimeReplyToId>MimeReplyToId</MimeReplyToId>
    <CalendarUid>CalendarUid</CalendarUid>
  </response>
</result>