Save a template message
PUT /api/2.0/mail/templates/save
Request
Saves a template message with the ID specified in the request.
Authorization
An API key is a token that you provide when making API calls. Include the token in a header parameter called Authorization
.
Example: Authorization: 864FE52C-1C1C-469F-9308-51DAFEFE7436
.
Headers
- Accept
enum of string
Can be one of:
application/json
.- Content-Type
enum of string
Can be one of:
application/json
.
Body
- id
integer
Template ID which will be saved
- from
string
Mail address from which a letter will be sent. Format: Name <name@domain>
- to
array of string
List of mail addresses to which a letter will be sent. Format: Name <name@domain>
- cc
array of string
List of Cc (carbon copy) mail addresses. Format: Name <name@domain>
- bcc
array of string
List of Bcc (blind carbon copy) mail addresses. Format: Name <name@domain>
- mimeReplyToId
string
Message ID to which this message is replying to
- importance
boolean
Specifies if this message is important or not: true - important, false - not important
- subject
string
Message subject
- tags
array of integer
List of tag IDs added to the message
- body
string
Message body as the HTML string
- attachments
array of object
List of message attachments
- fileId
integer
int32 - fileName
string
- size
integer
int64 - contentType
string
- needSaveToTemp
boolean
- contentId
string
- fileNumber
integer
int32 - storedName
string
- streamId
string
- attachedAsLink
boolean
- tempStoredUrl
string
- calendarIcs
string
Calendar event in the iCal format for sending
Examples
PUT /api/2.0/mail/templates/save HTTP/1.1
Accept: application/json
Content-Length: 423
Content-Type: application/json
Host: example.com
{
"attachments": [
{
"value": {
"fileId": "1234",
"fileName": "fileName",
"size": "1234",
"contentType": "contentType",
"needSaveToTemp": "true",
"contentId": "contentId",
"fileNumber": "333",
"storedName": "storedName",
"streamId": "streamId",
"attachedAsLink": "true",
"tempStoredUrl": "tempStoredUrl"
}
}
]
}
curl --request PUT \
--url https://example.com/api/2.0/mail/templates/save \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"attachments": [
{
"value": {
"fileId": "1234",
"fileName": "fileName",
"size": "1234",
"contentType": "contentType",
"needSaveToTemp": "true",
"contentId": "contentId",
"fileNumber": "333",
"storedName": "storedName",
"streamId": "streamId",
"attachedAsLink": "true",
"tempStoredUrl": "tempStoredUrl"
}
}
]
}'
Responses
200
Saved template message
- Attachments
array of object
- fileId
integer
int32 - fileName
string
- size
integer
int64 - contentType
string
- needSaveToTemp
boolean
- contentId
string
- fileNumber
integer
int32 - storedName
string
- streamId
string
- attachedAsLink
boolean
- tempStoredUrl
string
- Introduction
string
- HtmlBody
string
- ContentIsBlocked
boolean
- Important
boolean
- Subject
string
- HasAttachments
boolean
- Bcc
string
- Cc
string
- To
string
- Address
string
- From
string
- ReplyTo
string
- Id
integer
int32 - ChainId
string
- ChainDateString
string
- DateString
string
- DateDisplay
string
- TagIds
array of integer
- LabelsInString
string
- IsNew
boolean
- IsAnswered
boolean
- IsForwarded
boolean
- TextBodyOnly
boolean
- Size
integer
int64 - EMLLink
string
- StreamId
string
- RestoreFolderId
enum of integer
int32 [0 - Sending, 1 - Inbox, 2 - Sent, 3 - Draft, 4 - Trash, 5 - Spam, 6 - UserFolder, 7 - Templates]
Can be one of:
Sending
,Inbox
,Sent
,Draft
,Trash
,Spam
,UserFolder
,Templates
.- Folder
enum of integer
int32 [0 - Sending, 1 - Inbox, 2 - Sent, 3 - Draft, 4 - Trash, 5 - Spam, 6 - UserFolder, 7 - Templates]
Can be one of:
Sending
,Inbox
,Sent
,Draft
,Trash
,Spam
,UserFolder
,Templates
.- UserFolderId
array of integer
- ChainLength
integer
int32 - WasNew
boolean
- IsToday
boolean
- IsYesterday
boolean
- ReceivedDate
string
- IsBodyCorrupted
boolean
- HasParseError
boolean
- MimeMessageId
string
- MimeReplyToId
string
- CalendarUid
string
- ReadRequestStatus
boolean
401
Unauthorized