CreateMessage/ creates a message using either the Copy/Paste Template or the Newsmanager Template. A few caveats:
- Confirm that the information passed to HTMLVersion is contained on one line
- Confirm that this content is wrapped with any applicable escape characters (raw HTML code contains a variety of characters that are required to be escaped when passed via JSON, XML, or any variety of programming languages)
Template IDs
- 6 Blank Template
- 143 Copy Paste
- 100 Newsmanager
- 141 TextOnly
If the above IDs are not used – a partial success may be posted for the response: "Cannot use PnP or SnP template through API. Message was created but message template and content were not updated."
The message will require that one of the templates above is selected. If another template is selected (e.g., an editor template), the content that was passed via the API call will be overwritten with the HTML from the Editor Template.
Example
Create a message:
EXAMPLE:
{
"SessionID":"00000000-00000-0000-0000000000000",
"UserID":"SAMPLE",
"AutoUnsubscribeLink":true,
"CopyPasteTemplate":false,
"HTMLVersion":"<html> <Title>Happy Birthday!</Title> <Header> <b> Time to Celebrate </b> <span> <Header> <Body><i>Happy Birthday </i> </br> to you! </Body> </html>",
"LoginID":123456,
"MessageCategoryID":123456,
"MessageName":"Message Name",
"SubjectLine":"Message Subject",
"TemplateID":6,
"TextVersion":"Testing akjfkajfkajfkj"
}
HTTP POST
https://dna.magnetmail.net/ApiAdapter/Rest/CreateMessage/
POST Parameters
NOTE: This call does not have optional parameters.
Required Parameters
Parameter | Value | Description |
---|---|---|
SessionID | String | This is an authentication token which can be obtained by making the authenticate call. |
UserID | String | The UserID returned in the authenticate call. |
LoginID | Int | The login ID of the individual sending the message. This is returned in the authenticate call. |
AutoUnsubscribeLink | Boolean |
This parameter only applies to the Template value.
|
CopyPasteTemplate | Boolean | If set to True – based on the value for AutoUnsubscribeLink will either select the Copy Paste or Newsmanager template and override the Template ID selection. |
HTMLVersion | String | The HTML content of the message. |
MessageName | String | This is the name for the message, it is limited to 100 characters |
SubjectLine | String | This is the Subject Line of the message, up to 100 characters. This can be changed via the Send page or API call. |
TemplateID | Int | The template ID used. Refer to the beginning of this article for the values available. |
TextVersion | String | The Text content of the message. |
Conditional Parameters
You may also include following parameter (that may be required under certain conditions).
WARNING: If your account has MESSAGE CATEGORY as the unsubscribe, this parameter is required.
Parameter | Value | Description |
---|---|---|
MessageCategoryID | Int | This is the Message Category ID, to solicit a list of categories use the call GetMessageCategory/. |