{

Create a mailing

Create a new mailing

POST https://api.cmtelecom.com/bulkemail/v1.0/accounts/{accountID}/mailings

POST Parameters

Name In Description Required Type Example
AccountID Path The account guid True Guid A8C062E4-ECFD-48D0-89B1-A37D2622B7A9
Body Body The mailing to create True Json object { "Name": "Demo", "Template": { "Name": "Demo Template", "Description": "Demo description", "HtmlBody": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html><body><p> Hello {{ Recipient.Name }}</p></body></html>", "TextBody": "Hello {{ Recipient.Name }}", "MergeFields": { "MergeTags": [ { "Name": "Recipient.Name", "Value": "{{ Recipient.Name }}", "Mapping": "Recipient.MergeFieldValue1" }, { "Name": "Sender.EmailAddress", "Value": "{{ Sender.EmailAddress }}", "Mapping": "Sender.EmailAddress" }, { "Name": "Recipient.EmailAddress", "Value": "{{ Recipient.EmailAddress }}", "Mapping": "Recipient.EmailAddress" } ], "SpecialLinks": [ { "Type": "system", "Label": "Unsubscribe", "Link": "[[ SpecialLink.Unsubscribe ]]", "Mapping": "SpecialLink.Unsubscribe" }, { "Type": "system", "Label": "Subscribe", "Link": "[[ SpecialLink.Subscribe ]]", "Mapping": "SpecialLink.Subscribe" }, { "Type": "system", "Label": "View in browser", "Link": "[[ SpecialLink.ViewInBrowser ]]", "Mapping": "SpecialLink.ViewInBrowser" }, { "Type": "system", "Label": "Viewed", "Link": "[[ SpecialLink.Pixel ]]", "Mapping": "SpecialLink.Pixel" } ] } }, "FromName": "John Doe", "FromAddressID": "05923f4c-eb2e-4e4b-a07a-096fcbb2697a", "Subject": "Demo", "ToAddressListID": "3de57f95-9d82-48f6-8173-9492df295615", "MailingState": 2, "ScheduledOn": null }
X-CM-PRODUCTTOKEN Header Your product token True Guid C24A5029-37DD-4161-9728-F80D8639588E

Responses

Http status Description Example
201 Mailing created { "ID": "f2dce6dd-f67c-48d8-b77e-bdeffc23424c", "AccountID": "a8c062e4-ecfd-48d0-89b1-a37d2622b7a9", "Name": "Demo", "Template": { "ID": "dfd26818-88e9-4d1a-8a79-20ce44ea12fa", "AccountID": "a8c062e4-ecfd-48d0-89b1-a37d2622b7a9", "Name": "Demo Template", "Description": "Demo description", "HtmlBody": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html><body><p> Hello {{ Recipient.Name }}</p></body></html>", "TextBody": "Hello {{ Recipient.Name }}", "Json": null, "MergeFields": { "MergeTags": [ { "Name": "Recipient.Name", "Value": "{{ Recipient.Name }}", "Mapping": "Recipient.MergeFieldValue1" }, { "Name": "Sender.EmailAddress", "Value": "{{ Sender.EmailAddress }}", "Mapping": "Sender.EmailAddress" }, { "Name": "Recipient.EmailAddress", "Value": "{{ Recipient.EmailAddress }}", "Mapping": "Recipient.EmailAddress" } ], "SpecialLinks": [ { "Type": "system", "Label": "Unsubscribe", "Link": "[[ SpecialLink.Unsubscribe ]]", "Mapping": "SpecialLink.Unsubscribe" }, { "Type": "system", "Label": "Subscribe", "Link": "[[ SpecialLink.Subscribe ]]", "Mapping": "SpecialLink.Subscribe" }, { "Type": "system", "Label": "View in browser", "Link": "[[ SpecialLink.ViewInBrowser ]]", "Mapping": "SpecialLink.ViewInBrowser" }, { "Type": "system", "Label": "Viewed", "Link": "[[ SpecialLink.Pixel ]]", "Mapping": "SpecialLink.Pixel" } ] }, "CreatedOn": "2017-08-08T15:25:40.9959989+02:00", "ModifiedOn": "2017-08-08T15:25:40.9959989+02:00", "DeletedOn": null }, "FromName": "John Doe", "FromAddressID": "05923f4c-eb2e-4e4b-a07a-096fcbb2697a", "Subject": "Demo", "ToAddressListID": "3de57f95-9d82-48f6-8173-9492df295615", "MailingState": 2, "ScheduledOn": null, "TotalRecipients": 1, "CreatedOn": "2017-08-08T15:25:40.9959989+02:00", "ModifiedOn": "2017-08-08T15:25:40.9959989+02:00", "DeletedOn": null }
400 Bad request

Try it out