Edit a document. Only the fields that have data are updated. To overwrite an existing field and replace it with no data, or to rename the document, use the web interface.
Post
/API/Rest/Documents/Edit
| documentName | The name of the document to edit. |
| documentText | (Optional) The text portion of the content. |
| documentHtml | (Optional) The HTML portion of the content. |
| charsetId | (Optional) The character set ID or name for the content. Ex: 65001 |
| delimiterStart | (Optional) The delimiter to use to mark the start of a mail merge section. Default is [-, or {{ or [[ |
| delimiterEnd | (Optional) The delimiter to use to mark the end of a mail merge section. Default is -], or }} or ]] |
| headerFrom | (Optional) The header section "from" address. format like: "some name"<someone@example.com> |
| headerTo | (Optional) The "to" address in the header. Should normally be mail merge tag NameEmail |
| Subject | (Optional) The subject line for the email message |
| bodyLanguageId | (Optional) The language identifier for the language used in the content. Ex: 1033 |
| replyTo | (Optional) The email address where replies should be sent. Can include mail merge tags. Ex: "Joe Sales"<joe@example.com> |
| additionalHeaders | (Optional) A dictionary of keys and values that should be added to the message headers. |
| priority | (Optional) An integer between 1 and 9 of the priority of this document compared with other mail sent from this customer. 1 is highest, 9 is lowest, 5 is default. |
| trackedLinks | (Optional) An array of the links in the content that should be tracked. Used only if you don't want every link tracked. |
| trackAllLinks | (Optional) Boolean of whether to track all the links found in the content. Overridden by the trackedLinks array. |
| recipientLoggingLevel | (Optional) What level of logs to keep?(N)o logs, (E)rrors, or (A)ll, including successess. Default is (E)rrors. |
| unsubscribeTopic | (Optional) The name of the topic to use to record unsubscribes against. |
| detectOpens | (Optional) Boolean of whether to track opens for this document. Default is true. |
| virtualIpGroup | (Optional) If you have multiple IP addressed configured in the system, which one should be used for sending this document? |
EditDocument
No Permission
DocumentName cannot be missing
DocumentName is too long. Please limit to 25 characters or less
Document not found to edit.
Invalid UnsubscribeTopic
Invalid CharsetId
Invalid BodyLanguageId
Invalid DelimiterStart. Recommend [- Alternatively {{ or [[
Invalid DelimiterEnd. Recommend -] Alternatively }} or ]]
Mismatched delimiters. Use [- -], {{ }}, or [[ ]]
Invalid Header From value and no default defined. Must be a valid email address, optionally with a user name
Invalid Header To value and no default defined. Must be a valid email address, optionally with a user name
Invalid Reply To value and no default defined. Must be a valid email address, optionally with a user name
Invalid Header From value. Must be a valid email address, optionally with a user name"
Invalid Header To value. Must be a valid email address, optionally with a user name
Invalid Reply To value. Must be a valid email address, optionally with a user name
The subject cannot be blank
Invalid priority value. 1 is highest, 9 is lowest.
Invalid RecipientLoggingLevel. Allowed values are (A)ll, (E)rrors, or (N)one
Invalid VirtualIpGroup value.
Additional headers cannot be blank for the key or the value
Invalid additional headers key:
The following link to be tracked was not found in the content:
Database error
Unknown error
Success
Modify a document.
using System;
using System.Net.Http;
using System.Text;
string url = "https://example.com/API/Rest/Documents/Edit";
string message = "{\"accountName\":\"acme\",\"login\":\"ApiUser\",\"password\":\"YOUR_PASSWORD\",\"documentName\":\"JunkMe2\",\"documentText\":\"I have modified the document text\"}";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
request.Content = new StringContent(message, Encoding.UTF8, "application/json");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
# encoding: utf-8
require 'rest-client'
require 'json'
url = 'https://example.com/API/Rest/Documents/Edit'
args = {'accountName'=>'acme', 'login'=>'ApiUser', 'password'=>'YOUR_PASSWORD', 'documentName'=>'JunkMe2','documentText'=>'I have modified the document text'}
response = RestClient.post(url, args.to_json, :content_type => "application/json;charset=utf-8")
puts response
import requests
url = "https://example.com/API/Rest/Documents/Edit"
args = {'accountName':'acme','login':'ApiUser','password':'YOUR_PASSWORD','documentName':'JunkMe2','documentText':'I have modified the document text'}
headers = {'Content-Type': 'application/json'}
resp = requests.post(url, json=args, headers=headers)
if resp.status_code == 200:
print(resp.text)
curl --request POST --header "Content-Type: application/json" --data '{"accountName":"acme","login":"ApiUser", "password":"YOUR_PASSWORD", "documentName":"JunkMe2", "documentText":"I have modified the document text"}' "https://example.com/API/Rest/Documents/Edit"