Getting Started
The CM Email Marketing API (Application Programming Interface) is a RESTful API enabling the integration of CM Email Marketing with other applications and systems including accounting, email marketing, CMS, SMS, ERP and eCommerce. The REST API makes use of 4 HTTP methods:GET, POST, PUT and
DELETE which allow API users to retrieve, create, update and delete records within CM Email
Marketing platform. The HTTPS protocol should be used for all requests made to the API. All requests and
responses are passed or returned in JSON format.
The flexibility of the CM Email Marketing API means that users can use it to develop brand new
applications or integrate and establish data flows between CM Email Marketing and other existing
applications.
For any further information regarding the API, please contact CM Email Marketing Support on: support@campaignmaster.co.uk.
Limits
Each API call except the authentication one returns a number of different headers which provide feedback on the API limits for the API user making the requests. These headers are explained in more detail below.| Header | Details |
|---|---|
| x-rate-limit-limit | Integer value indicating the maximum number of calls per hour for the API user. Default limit is 5,000 calls per hour and 50,000 calls per month. |
| x-rate-limit-remaining | Integer value indicating the number of remaining calls per hour for the API user. |
| x-rate-limit-reset | Unix time indicating when the calls per hour limit will be reset. |
| x-token-reset | Unix time indicating when the authentication token will be reset. Default token expiry is 720 minutes (12 hours). |
Methods
The CM Email Marketing API accepts requests of 4 different types:GET, POST,
UPDATE, DELETE. Each of the 4 types are described in further details below.
| Method | Details |
|---|---|
| GET | Use to retrieve data from the server. |
| POST | Use to send new resources to the server. |
| PUT | Use to update existing resources. |
| DELETE | Use to delete resources. |
Status Codes
As a response to each call, the CM Email Marketing API returns a status code indicating the result of the request. The status codes returned are described in details below.| Status Code | Details |
|---|---|
| 200 OK | Returned when the API request is successful. |
| 201 Created | Returned when the resource creation is successful. |
| 400 Bad Request | Returned when there is a client error in the request e.g. malformed request syntax. |
| 401 Unauthorized | Returned when authentication failed e.g. token missing/invalid. |
| 404 Not Found | Returned when the resource cannot be found. |
| 429 Too Many Requests | Returned when the limit of API requests per hour/month is reached. |
| 500 Internal Server Error | Returned when an unexpected server error has occured. |
Prerequisites
To start using CM Email Marketing API, please ensure the following beforehand:API Module Enabled Ensure that you have purchased API module, check with your account
manager if you have not already.
API User Created If you have purchased the module already, ensure you have created API
user in your account. Contact support@campaignmaster.co.uk if you are not sure how to do it.
Authentication
This section describes the/authenticate endpoint, necessary to authorise the client with
the CM Email Marketing platform and make requests to the other API endpoints:
{{apiurl}}Please contact support or your account manager to access api url.
{{api-version}}Please contact support or your account manager for api version.
Authenticate
In order to use API, a new API user has to be created before authentication. This can be done by going into CM Email Marketing account -> Settings -> Api Users. Once you have created a user then you can generate an authentication token by passing username and password into request headers. Once a token is generated, this will be used for all other requests to the API. This token needs to be added as a bearer token in Authorization for all other requests to API.Details
- Endpoint
- POST
{{api-url}}/api/{{api-version}}/authenticate
- Request Headers
-
username: {{username}} password: {{password}}
- Response – 200 OK
-
{ "token": "{{token}}" }
Example Request
var options = new RestClientOptions("{{api-url}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/authenticate", Method.Post);
request.AddHeader("username", "{{username}}");
request.AddHeader("password", "{{password}}");
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{api-url}}/api/{{api-version}}/authenticate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'username' => '{{username}}',
'password' => '{{password}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Account
Fetch information related to an account in this section.Get domains
This endpoint will fetch domains associated to your CM Email Marketing account using GET http method.Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/domainlistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "DomainName": "abc.example.com" }, { "DomainName": "xyz.example.com" } ] }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/account/domainlistfetch", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/account/domainlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Automation
This section outlines all API endpoints which allow you to manage automation campaigns within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/automation/getautomationcampaigns
- {{apiurl}}/api/{{api-version}}/automation/getautomationcampaignresults
Get automation campaigns
This endpoint will fetch all automated campaigns in your CM email marketing account.Supported method: Get
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/automation/getautomationcampaigns
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": [ { "CampaignID": "CMP122CON124", "CampaignName": "Atmn Camp 1", "CampaignDescription": "Atmn Camp 1", "CampaignStatus": "Approved", "CreatedDate": "23/08/2022 11:59", "ModifiedDate": "23/08/2022 11:59" }, { "CampaignID": "CMP130CON132", "CampaignName": "Atmn Camp 5", "CampaignDescription": "Atmn Camp 5", "CampaignStatus": "Draft", "CreatedDate": "31/08/2022 16:05", "ModifiedDate": "31/08/2022 16:05" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/automation/getautomationcampaigns")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/automation/getautomationcampaigns');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get automation campaign results
This endpoint will fetch automation campaign results in your CM email marketing account.Supported method: Post
Details
- Endpoint
- POST
{{api-url}}/api/{{api-version}}/automation/getautomationcampaignresults
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": [ { "RuleID": "1", "RuleName": "Client Flow 1", "CampaignID": "CMP125CON127", "CampaignName": "Atmn Camp 4", "RecipientID": "79", "RecipientEmail": "recipient1@example.com", "SentDate": "25/08/2022 14:22" }, { "RuleID": "1", "RuleName": "Client Flow 1", "CampaignID": "CMP125CON127", "CampaignName": "Atmn Camp 4", "RecipientID": "79", "RecipientEmail": "recipient1@example.com", "SentDate": "23/08/2022 12:40" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/automation/getautomationcampaignresults")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/automation/getautomationcampaignresults');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Campaigns
This section outlines all API endpoints which allow you to manage campaigns within your CM Email Marketing account.- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwiplistfetch
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignfetchbyid{{CampaignID}}
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignfetchhtmlcontent{{CampaignID}}
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignfetchtextcontent{{CampaignID}}
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaigncreate
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignedit
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddhtmlcontent
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddtextcontent
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignattachlist
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignsendtestemail
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignlaunchimmediately
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignschedule
- {{apiurl}}/api/{{api-version}}/campaigns/resendtorcptfromregularsentcampaign
- {{apiurl}}/api/{{api-version}}/campaigns/resendtolistfromregularsentcampaign
- {{apiurl}}/api/{{api-version}}/campaigns/resendusingcriteriafromregularsentcampaign
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignresendschedule
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaigninformationfetchbyid
- {{apiurl}}/api/{{api-version}}/campaigns/campaignpreviewlinkgenerate
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwipdelete/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaigns/GetCampaignChannels/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaigns/AttachCampaignChannels
- {{apiurl}}/api/{{api-version}}/campaigns/DetachCampaignChannels
Get WIP campaigns
This endpoint will fetch WIP campaigns created in your CM Email Marketing account using GET http method.Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignwiplistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "CampaignID": "CMP123456789", "CampaignName": "Demo Campaign Name", "CampaignDescription": "Demo Campaign Description", "CreatedDate": "04/10/2023 00:03", "ModifiedDate": "04/10/2023 00:03" } ] }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/campaigns/regularcampaignwiplistfetch", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/campaigns/regularcampaignwiplistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign by ID
This endpoint will fetch information for a single campaign created in your CM Email Marketing account using GET http method. CampaignID is required for this call.Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchbyid/{{CampaignID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": { "CampaignID": "CMP123456789", "CampaignName": "Demo Campaign Name", "CampaignDescription": "Demo Campaign Description", "Subject": "Demo Campaign Created from API", "FromName": "Demo", "FromAddress": "example@sub.abc.co.uk", "PreheaderText": "Demo Campaign Pre Header API", "EnableReplies": "False", "RedirectEmail": "redirect@abc.co.uk", "ListID": "", "Status": "WIP", "CreatedDate": "07/08/2023 15:13", "ModifiedDate": "30/08/2023 15:28" } }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/campaigns/regularcampaignfetchbyid/{{CampaignID}}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/campaigns/regularcampaignfetchbyid/{{CampaignID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign HTML content
This endpoint will fetch HTML content for a single campaign created in your CM Email Marketing account using GET http method. CampaignID is required for this call.Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchhtmlcontent/{{CampaignID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": { "CampaignID": "CMP123456789", "HtmlContent": "HTML Content", } }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/campaigns/regularcampaignfetchhtmlcontent/{{CampaignID}}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/campaigns/regularcampaignfetchhtmlcontent/{{CampaignID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign TEXT content
This endpoint will fetch TEXT content for a single campaign created in your CM Email Marketing account using GET http method. CampaignID is required for this call.Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchtextcontent/{{CampaignID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": { "CampaignID": "CMP123456789", "TextContent": "TEXT Content", } }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/campaigns/regularcampaignfetchtextcontent/{{CampaignID}}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/campaigns/regularcampaignfetchtextcontent/{{CampaignID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Create a campaign
This endpoint will allow you to create a campaign in your CM Email Marketing account. A campaign created using this call will be created using open editor by default in CM Email Marketing account. If a TemplateId parameter is defined, then a campaign will be created with the editor used in the template.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigncreate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignName":"API Campaign 1", "campaignDescription":"API Campaign Description", "templateid":"TMP1234566" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP123456789", "CampaignName": "API Campaign 1", "CampaignDescription": "API Campaign Description", "CreatedDate": "13/10/2023 13:23", "ModifiedDate": "13/10/2023 13:23", "Message": "Campaign created successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaigncreate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignName"":""API Campaign 1"",""campaignDescription"":""API Campaign Description"", ""TemplateId"":""TMP1234566""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaigncreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignName":"API Campaign 1","campaignDescription":"API Campaign Description", "TemplateId":"TMP1234566"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update a campaign
This endpoint will allow you to update a campaign information in your CM Email Marketing account. You can update information like CampaignName, FromName, SubjectLine, FromAddress, PreheaderText and EnabledReplies in an existing template using this request. Campaign has to exist in your CM Email Marketing account in order to update the information. You can use Get WIP Campaigns call to fetch existing campaigns from an account. This call will override the existing information with the new information provided. Please ensure that FromAddress contains a subdomain that is assigned to your account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignedit
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "FromName":"Demo", "SubjectLine":"Demo Campaign Created from API", "FromAddress":"example@sub.abc.co.uk", "RedirectEmailAddress":"redirect@abc.co.uk", "preheadertext":"Demo Campaign Pre Header API", "EnableReplies":"0" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP123456789", "CampaignName": "API Campaign 1", "CreatedDate": "13/10/2023 13:23", "ModifiedDate": "13/10/2023 13:23", "Message": "Campaign updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignedit", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""FromName"":""Demo"",""SubjectLine"":""Demo Campaign Created from API"",""FromAddress"":""example@sub.abc.co.uk"",""RedirectEmailAddress"":""redirect@abc.co.uk"",""preheadertext"":""Demo Campaign Pre Header API"", ""EnableReplies"":""0""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","FromName":"Demo","SubjectLine":"Demo Campaign Created from API","FromAddress":"example@sub.abc.co.uk","RedirectEmailAddress":"redirect@abc.co.uk","preheadertext":"Demo Campaign Pre Header API", "EnableReplies":"0"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add or update campaign HTML content
This endpoint will allow you to update HTML content of a campaign in your CM Email Marketing account. Campaign has to exist in your CM Email Marketing account in order to update the information. You can use Get WIP Campaigns call to fetch existing campaigns from an account. CampaignID and HtmlContent parameters are required for this call. This call will override the existing HTML of a campaign with the new one HTML provided.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddhtmlcontent
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "HtmlContent":"Html Content added through API." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign html updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignaddhtmlcontent", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP148CON165"", ""HtmlContent"":""Html Content added through API.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignaddhtmlcontent');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON165", "HtmlContent":"Html Content added through API."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add or update campaign TEXT content
This endpoint will allow you to update TEXT content of a campaign in your CM Email Marketing account. Campaign has to exist in your CM Email Marketing account in order to update the information. You can use Get WIP Campaigns call to fetch existing campaigns from an account. CampaignID and TextContent parameters are required for this call. This call will override the existing TEXT content of a campaign with the new one TEXT content provided.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddtextcontent
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "TextContent":"Text Content added through API." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign text updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignaddtextcontent", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"", ""TextContent"":""Text Content added through API.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignaddtextcontent');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789", "TextContent":"Text Content added through API."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Generates an editor link
Using this call an editor link will be generated for a CampaignID specified in the URL of this request. You can use this link to directly open an editor to modify campaign content.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate/{{CampaignID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate/ABCD1234
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
https://editorlinkurlgenerated
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaigneditorlinkcreate/ABC12345", Method.Get);
request.AddHeader("Authorization", {{token}});
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaigneditorlinkcreate/ABC12345');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Attach a list to campaign
This endpoint will allow you to attach a list to your campaign. Campaign has to exist in your CM Email Marketing account in order to attach a list. You can use Get WIP Campaigns call to fetch existing campaigns from an account. CampaignID and ListID parameters are required for this call.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignattachlist
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "ListID":"ABC1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "List attached successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignattachlist", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP148CON165"", ""ListID"":""ABC1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignattachlist');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON165", "ListID":"ABC1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Send a campaign test
This endpoint will allow you to send a test for a WIP campaign created in your CM Email Marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignsendtestemail
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "PersonalisationEmailAddress":"example@example.com", "TestEmailAddresses":"example@example.com" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Test emails sent successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignsendtestemail", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""PersonalisationEmailAddress"":""example@example.com"",""TestEmailAddresses"":""example@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignsendtestemail');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","PersonalisationEmailAddress":"example@example.com","TestEmailAddresses":"example@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Launch a campaign immediately
This endpoint will allow you to launch a WIP campaign created in your CM Email Marketing account. A campaign has to be tested first before launching. Use Send a campaign test call to test a campaign.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignlaunchimmediately
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign launched successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignlaunchimmediately", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignlaunchimmediately');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Schedule a WIP campaign
This endpoint will allow you to schedule a WIP campaign created in your CM Email Marketing account. A campaign has to be tested first before launching. Use Send a campaign test call to test a campaign.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignschedule
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "ScheduleDateTime":"2023-11-03 14:20" //Date format should be (yyyy-mm-dd hh:mm) }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign launched successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignschedule", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""ScheduleDateTime"":""2023-11-03 14:20""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignschedule');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","ScheduleDateTime":"2023-11-03 14:20"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Resend a sent campaign to a single recipient
Resend sent campaign to the recipient based on CampaignID, EmailAddress and ListID. Recipients who have received this campaign already will not receive this campaign.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/resendtorcptfromregularsentcampaign
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "EmailAddress":"example@dummyemail.com", "ListID":"ABC1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Resend campaign job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/resendtorcptfromregularsentcampaign", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""EmailAddress"":""example@dummyemail.com"",""ListID"":""ABC1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/resendtorcptfromregularsentcampaign');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","EmailAddress":"example@dummyemail.com","ListID":"ABC1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Resend a sent campaign to a list
Resend sent campaign to a list based on CampaignId and ListID. Recipients who have received this campaign already will not receive this campaign.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/resendtolistfromregularsentcampaign
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "ListID":"ABC1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Resend campaign job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/resendtolistfromregularsentcampaign", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""ListID"":""ABC1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/resendtolistfromregularsentcampaign');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","ListID":"ABC1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Resend a sent campaign using an advance criteria
Resend sent campaign to a list based on CampaignID and Criteria. Recipients who have received this campaign already will not receive this campaign.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/resendusingcriteriafromregularsentcampaign
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"dummy","LogicalOperator":"and","LeftParentheses":false,"RightParentheses":false}] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Resend campaign job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/resendusingcriteriafromregularsentcampaign", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""Criteria"":[{""FieldName"":""Email Address"",""Operator"":""contains"",""FieldValue"":""qamar"",""LogicalOperator"":""and"",""LeftParentheses"":false,""RightParentheses"":false}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/resendusingcriteriafromregularsentcampaign');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"dummy","LogicalOperator":"and","LeftParentheses":false,"RightParentheses":false}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign details by CampaignID
This endpoint will fetch information for campaigns created in your CM Email Marketing account using GET http method. CampaignIDList is required for this call and it can contains multiple campaign IDs.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigninformationfetchbyid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignIDList":[{"CampaignID":"CMP123456789"}] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": { "CampaignID": " CMP123456789", "CampaignName": "Test Campaign", "CampaignDescription": "Test Campaign", "CampaignStatus": "Campaign Results", "SendDate": "03/05/2025 17:30", "CreatedDate": "03/05/2025 17:25", "ModifiedDate": "03/05/2025 17:26" } }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaigninformationfetchbyid", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignIDList"":[{""CampaignID"":""CMP1CON1""},{""CampaignID"":""CMP2CON2""}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaigninformationfetchbyid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignIDList":[{"CampaignID":"CMP1CON1"},{"CampaignID":"CMP2CON2"}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Resend campaign to non opens and soft bounces
This endpoint allows you to schedule a resend of a sent campaign to recipients who either did not open the campaign or experienced a soft bounce.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignresendschedule
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "NonOpenNewSubjectLine":"new subject line for the campaign to non-opens", "NonOpensScheduleDateTime":"2025-12-12 14:15", "SoftBouncesScheduleDateTime":"2025-12-12 14:15" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Non-opens and soft bounces scheduled successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/regularcampaignresendschedule", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""NonOpenNewSubjectLine"":"new subject line for the campaign to non-opens",""NonOpensScheduleDateTime"":"2025-12-12 14:15",""SoftBouncesScheduleDateTime"":"2025-12-12 14:15"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/regularcampaignresendschedule');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","NonOpenNewSubjectLine":"new subject line for the campaign to non-opens","NonOpensScheduleDateTime":"2025-12-12 14:15","SoftBouncesScheduleDateTime":"2025-12-12 14:15"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Generate campaign preview link
This call will generate a preview of the campaign. If you want a personalized preview, you can provide the recipient ID. The Campaign ID is required for this call.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/campaignpreviewlinkgenerate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "RecipientID":"RCP1I1O1051" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ https://previewlinkurlgenerated }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/campaignpreviewlinkgenerate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""RecipientID"":""RCP1I1O1051""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/campaignpreviewlinkgenerate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","RecipientID":"RCP1I1O1051"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a WIP campaign
This endpoint will delete a WIP campaign based on a campaign id.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwipdelete/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwipdelete/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaigns/regularcampaignwipdelete/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaigns/regularcampaignwipdelete/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get channels attached to a campaign
This endpoint will get channels attached to a campaign in your CM Email Marketing account using GET http method. CampaignID is required for this call.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaigns/GetCampaignChannels/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/campaigns/GetCampaignChannels/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "ID": 1, "Name": "Newsletters" }, { "ID": 2, "Name": "Sports" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaigns/GetCampaignChannels/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaigns/GetCampaignChannels/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Attach channels to a campaign
This endpoint will allow you to attach channels to a campaign. CampaignID and ChannelID parameters are required for this call.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaigns/attachcampaignchannels
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "ChannelID":[1,2] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Channel(s) attached to this campaign successfully."" } // in case of some channel ids passed as parameters are not valid. { "Message": "The operation could not be completed due to invalid channel ID(s): 2" } // in case of all channel IDs are valid, but none of them are attached with a campaign. { "Message": "No channel attached to this campaign." } // in case of all channel IDs are valid, some of them are attached to a campaign and some are not. { "Message": "Channel(s) attached this campaign successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/attachcampaignchannels", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{"CampaignID":"CMP148CON165", "ChannelID":[1,2]}}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/attachcampaignchannels');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON165", "ChannelID":[1,2]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Detach channels from a campaign
This endpoint will allow you to detach channels from a campaign. CampaignID and ChannelID parameters are required for this call.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/campaigns/detachcampaignchannels
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "CampaignID":"CMP123456789", "ChannelID":[1,2] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Channel(s) detached from this campaign successfully." } // in case of some channel ids passed as parameters are not valid. { "Message": "The operation could not be completed due to invalid channel ID(s): 2" } // in case of all channel IDs are valid, but none of them are attached with a campaign. { "Message": "No channel detached from this campaign." } // in case of all channel IDs are valid, some of them are attached to a campaign and some are not. { "Message": "Channel(s) detached from this campaign successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/detachcampaignchannels", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{"CampaignID":"CMP148CON165", "ChannelID":[1,2]}}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/detachcampaignchannels');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON165", "ChannelID":[1,2]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Campaign Results
This section outlines all API endpoints which allow you to retrieve campaign(s) information and their results within your CM Email Marketing account.- {{apiurl}}/api/{{api-version}}/campaignresults/campaignimagedownloads/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignresults/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyemailaddress
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbypages
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyrecipientid
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignuniqueopens/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/campaignunsubscribes/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbydaterange
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaigninformationfetchbyid
- {{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignactivityfetchbydate
- {{apiurl}}/api/{{api-version}}/campaigns/regularcampaignscheduledlistfetch
- {{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignsentlistfetch
- {{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignssentbydate
- {{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbytrackedlinkid
- {{apiurl}}/api/{{api-version}}/campaignresults/recipientengagementbydate
Get downloaded images
This endpoint will fetch a list of downloaded images of a given campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignimagedownloads/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignimagedownloads/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
[ { "EmailAddress": "recipient1@example.com", "LastImageDownloadDate": "12/04/2022 14:26" }, { "EmailAddress": "recipient2@example.com", "LastImageDownloadDate": "12/04/2022 12:36" } ]
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/CampaignImageDownloads/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/CampaignImageDownloads/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get recipient campaign activity
This endpoint will fetch the recipient activities of a given campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "OpensAll": "10", "OpensUnique": "3", "LinksClickedAll": "9", "LinksClickedUnique": "2", "ImageDownloadsAll": "10", "ImageDownloadsUnique": "3", "Complaints": "0", "GlobalUnsubscribes": "0", "ForwardToAFriendFormSubmissionsAll": "0", "ForwardToAFriendFormSubmissionsUnique": "0", "NoRecordActivity": "9" }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign results
This endpoint will fetch the results of a given campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresults/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresults/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP1CON1", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CampaignType": "Regular", "EditorType": "Hybrid Editor", "CampaignStatus": "Sent", "CreatedDate": "11/04/2022 12:41", "CreatedBy": "Recipient1", "ScheduledLaunchTime": "11/04/2022 12:57:00", "LaunchedBy": "super super", "TotalRecipients": "19", "TotalSuccessfulSends": "15", "TotalReceipts": "12", "TotalBounces": "1", "HardBounces": "1", "SoftBounces": "0", "OpensAll": "10", "OpensUnique": "3", "OpensReceiptsPercentage": "20%", "LinksClickedAll": "9", "LinksClickedUnique": "2", "LinksClickedReceiptsPercentage": "13.33%", "UniqueClicksToOpenRateReceiptsPercentage": "66.67%", "ImageDownloadsAll": "10", "ImageDownloadsUnique": "3", "ImageDownloadsReceiptsPercentage": "20%", "Complaints": "0", "ComplaintsReceiptsPercentage": "0%", "GlobalUnsubscribes": "0", "GlobalUnsubscribesReceiptsPercentage": "0%", "ForwardToAFriendFormSubmissions": "0", "ForwardToAFriendFormSubmissionsReceiptsPercentage": "0%", "NoRecordActivity": "9", "NoRecordActivityReceiptsPercentage": "47.37%" }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresults/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresults/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Campaign results by email
This endpoint will fetch the results of a given campaign based on recipient email address.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP131CON252","EmailAddress":"recipient1@example.com"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": { "RecipientID": "RCP2I6O1060", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CampaignRecievedDate": "11/04/2022 12:57", "Opens": "2", "Clicks": "1", "Forwards": "0", "Bounced": "No", "Unsubscribed": "No", "BounceType": null, "FirstTimeOpened": "12/04/2022 14:26:18", "LastTimeOpened": "12/04/2022 14:26:18", "FirstTimeClicked": "12/04/2022 14:27:06", "LastTimeClicked": "12/04/2022 14:27:06" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyemailaddress")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""EmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","EmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Paginated campaign results
This endpoint will fetch the results of a given campaign based on campaign id and by specifying page sizes.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbypages
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP1CON1","Pagenumber":"1","pagesize":"2"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": [ { "RecipientID": "RCP1I80O1", "EmailAddress": "recipient1@example.com", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CampaignRecievedDate": "11/05/2023 14:44", "Opens": "0", "Clicks": "0", "Forwards": "0", "Bounced": "Yes", "Unsubscribed": "No", "BounceType": "Hard", "FirstTimeOpened": "", "LastTimeOpened": "", "FirstTimeClicked": "", "LastTimeClicked": "" }, { "RecipientID": "RCP1I81O1", "EmailAddress": "recipient2@example.com", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CampaignRecievedDate": "11/05/2023 14:44", "Opens": "0", "Clicks": "0", "Forwards": "0", "Bounced": "Yes", "Unsubscribed": "No", "BounceType": "Hard", "FirstTimeOpened": "", "LastTimeOpened": "", "FirstTimeClicked": "", "LastTimeClicked": "" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbypages")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""Pagenumber"":""1"",""pagesize"":""2""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbypages');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","Pagenumber":"1","pagesize":"2"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Campaign results by recipient
This endpoint will fetch the results of a given campaign based on campaign id and recipient id.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyrecipientid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP253CON1293","RecipientID":"RCP1I168O1"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": { "RecipientID": "RCP1I7O1275", "EmailAddress": "test1@test.com", "CampaignName": "A-08", "CampaignDescription": "A-08", "CampaignRecievedDate": "01/02/2024 14:33", "Opens": "0", "Clicks": "0", "Forwards": "0", "Bounced": "Yes", "Unsubscribed": "No", "BounceType": "Hard", "FirstTimeOpened": "", "LastTimeOpened": "", "FirstTimeClicked": "", "LastTimeClicked": "" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyrecipientid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""RecipientID"":""RCP4I130217O9""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyrecipientid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","RecipientID":"RCP4I130217O9"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get recipient criteria
This endpoint will fetch the recipient criteria of a given campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Results": { "StartDate": "21/07/2023 10:39", "EndDate": "21/07/2023 11:18", "TotalRecipients": "12", "TotalActive": "7", "TotalInActive": "5", "TotalUnVerified": "2", "TotalDomainSuppressed": "2", "TotalGlobalSuppressed": "2", "TotalSystemDomainSuppressed": "0", "TotalSystemGlobalSuppressed": "0", "TotalChannelSuppressed": "0" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign send details
This endpoint will fetch the send details of campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Results": { "CampaignID": "CMP1CON1", "TotalMailSent": "15", "MultiPartSendCount": "13", "HtmlSendCount": "2", "TextSendCount": "0", "TotalBounce": "3", "HardBounceCount": "3", "SoftBounceCount": "0" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get unique opens
This endpoint will fetch the unique opens of campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignuniqueopens/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignuniqueopens/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
[ { "EmailAddress": "recipient1@example.com", "Opens": "2", "FirstTimeOpenedDate": "21/07/2023 10:41", "LastTimeOpenedDate": "21/07/2023 10:41" } ]
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignuniqueopens/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignuniqueopens/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get unsubscribers
This endpoint will fetch the list of recipients that have unsubscribed from a campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignunsubscribes/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/campaignunsubscribes/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "EmailAddress": "recipient1@example.com", "UnsubscribeDate": "05/02/2024 16:49" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignunsubscribes/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignunsubscribes/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get bounce history
This endpoint will fetch the bounce history of a campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "RecipientExternalID": "RCP1I7O1275", "EmailAddress": "test1@test.com", "BounceDate": "01/02/2024 14:33" }, { "RecipientExternalID": "RCP1I6O1275", "EmailAddress": "test2@test.com", "BounceDate": "01/02/2024 14:33" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get bounce history by date
This endpoint will fetch the bounce history of a campaign based on a date range criteria.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbydaterange
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"StartDate":"2022-07-01","EndDate":"2022-08-01"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": [ { "RecipientExternalID": "RCP4I9O1060", "EmailAddress": "recipient1@example.com", "BounceDate": "02/07/2022 03:40" }, { "RecipientExternalID": "RCP4I9O1060", "EmailAddress": "recipient2@example.com", "BounceDate": "31/07/2022 03:40" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbydaterange")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""StartDate"":""2024-01-14"",""EndDate"":""2024-01-16""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbydaterange');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"StartDate":"2024-01-14","EndDate":"2024-01-16"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign information
This endpoint will fetch information for a single or multiple campaigns created in your CM Email Marketing account using POST method.Supported method: POST
Details
- Endpoint
- POST
{{api-url}}/api/{{api-version}}/campaigns/regularcampaigninformationfetchbyid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "CampaignID": "CMP123456789", "CampaignName": "Demo Campaign Name", "CampaignDescription": "Demo Campaign Description", "CreatedDate": "04/10/2023 00:03", "ModifiedDate": "04/10/2023 00:03" } ] }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/campaigns/regularcampaignwiplistfetch", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/campaigns/regularcampaignwiplistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign activity by date
This endpoint will allow you to fetch campaign activity details for a given campaign within defined date range.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignactivityfetchbydate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"FromDate": "2022-04-01","ToDate":"2022-04-22"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "CampaignID": "CMP1CON1", "CampaignName": "Campaign 1", "CampaignDescription": "CMP1CON1", "OpensUnique": "2", "OpensTotal": "8", "ClicksUnique": "2", "ClicksTotal": "9", "ImageDownloadsUnique": "2", "ImageDownloadsTotal": "8", "ForwardsUnique": "0", "ForwardsTotal": "0", "BouncesTotal": "0", "UnsubscribesTotal": "0", "ComplaintsTotal": "0", "NoRecordActivityTotal": "1", "SentDate": "11/04/2022 12:57" }, { "CampaignID": "CMP4CON6", "CampaignName": "Campaign 2", "CampaignDescription": "CMP4CON6", "OpensUnique": "2", "OpensTotal": "4", "ClicksUnique": "1", "ClicksTotal": "2", "ImageDownloadsUnique": "2", "ImageDownloadsTotal": "4", "ForwardsUnique": "0", "ForwardsTotal": "0", "BouncesTotal": "0", "UnsubscribesTotal": "0", "ComplaintsTotal": "0", "NoRecordActivityTotal": "1", "SentDate": "13/04/2022 09:18" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignactivityfetchbydate/")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromDate"": ""2024-01-01"",""ToDate"":""2024-01-17""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignactivityfetchbydate/');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromDate": "2024-01-01","ToDate":"2024-01-17"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get scheduled campaigns
This endpoint will fetch the list of all scheduled campaigns.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignscheduledlistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Total Record(s)": "5", "Results": [ { "CampaignID": "CMP143CON1161", "CampaignName": "Testing Account 1027", "CampaignDescription": "Bounce rule Testing Account 1028", "SentDate": "21/04/2023 15:34" }, { "CampaignID": "CMP148CON1166", "CampaignName": "Testing Account 1028", "CampaignDescription": "Bounce rule 4 Testing Account 1028", "SentDate": "21/04/2023 16:00" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaigns/regularcampaignscheduledlistfetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaigns/regularcampaignscheduledlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get sent campaigns
This endpoint will fetch the list of all sent campaigns.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/campaignresults/regularcampaignsentlistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": [ { "CampaignID": "CMP1CON1", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CreatedDate": "11/04/2022 12:41", "ModifiedDate": "11/04/2022 12:57" }, { "CampaignID": "CMP157CON1182", "CampaignName": "Campaign 2", "CampaignDescription": "Campaign 2", "CreatedDate": "04/05/2023 12:17", "ModifiedDate": "04/05/2023 12:17" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignsentlistfetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignsentlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get sent campaigns by date
This endpoint will allow you to fetch list of campaigns sent between the specified date range.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignssentbydate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"FromDate": "2022-04-01","ToDate":"2022-04-22"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "6", "Results": [ { "CampaignID": "CMP1CON1", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "SentDate": "11/04/2022 12:57" }, { "CampaignID": "CMP4CON6", "CampaignName": "Campaign 2", "CampaignDescription": "Campaign 2", "SentDate": "13/04/2022 09:18" }, { "CampaignID": "CMP10CON12", "CampaignName": "Campaign 6", "CampaignDescription": "Campaign 6", "SentDate": "13/04/2022 17:22" }, { "CampaignID": "CMP35CON37", "CampaignName": " Campaign 9", "CampaignDescription": "Campaign 9", "SentDate": "21/04/2022 17:18" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignssentbydate/")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromDate"": ""2024-01-01"",""ToDate"":""2024-01-17""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignssentbydate/');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromDate": "2024-01-01","ToDate":"2024-01-17"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get tracked links by campaign id
This endpoint will fetch the tracked links of a campaign based on campaign id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP1CON1", "CampaignName": "Campaign 1", "CampaignDescription": "Campaign 1", "CampaignStatus": "Sent", "CampaignType": "Regular", "TrackedLinkResults": [ { "TrackedLinkID": "TRK1ENT1", "TrackedLinkName": "Tracked Sub", "ClicksAll": "3", "ClicksUnique": "1" }, { "TrackedLinkID": "TRK2ENT1", "TrackedLinkName": "Tracked DC", "ClicksAll": "5", "ClicksUnique": "1" }, { "TrackedLinkID": "TRK3ENT1", "TrackedLinkName": "Tracked Maintain My Details", "ClicksAll": "1", "ClicksUnique": "1" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get tracked links by link id
This endpoint will fetch the tracked links of a campaign based on campaign id and tracked link id.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbytrackedlinkid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP163CON1189","TrackedLinkID":"TRK1238ENT163","Pagenumber":"1","PageSize":"1"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP9CON11", "CampaignName": "A-08", "CampaignDescription": "A-08", "CampaignStatus": "Sent", "CampaignType": "Regular", "TrackedLinkID": "TRK2ENT9", "TrackedLinkName": "Add to Safe Senders Link", "TotalClicks": "1", "UniqueClicks": "1", "RecipientResults": [ { "RecipientID": "RCP1I1O1275", "EmailAddress": "test1@test.com", "TotalClicks": "1", "FirstTimeClicked": "01/02/2024 14:57", "LastTimeClicked": "01/02/2024 14:57" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbytrackedlinkid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP139CON260"",""TrackedLinkID"":""TRK567ENT139"",""Pagenumber"":""1"",""PageSize"":""10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbytrackedlinkid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP139CON260","TrackedLinkID":"TRK567ENT139","Pagenumber":"1","PageSize":"10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get recipient results by date
This endpoint will fetch the recipient results by date.Parameters
Required
- date : required (yyyy-mm-dd)
- pagenumber: required (a valid integer value)
- pagesize: required (a valid integer value)
- campaignid
- emailaddress
- sortby: One of the following values are required for this parameter
- Email Address
- Recipient ID
- Campaign ID
- Campaign Name
- Sent Date
- Opens
- Clicks
- Forwards
- Unsubscribe
- Unsubscribe Date
- Pause
- Pause Date
- Soft Bounce
- Hard Bounce
- Bounce Date
- sortorder: asc or desc
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/campaignresults/recipientengagementbydate - Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token - Request Body
-
Example: {"date":"2025-08-01","pagenumber":"1","pagesize":"5"} // this will return all recipients that have engagement on the specified date Example: {"date":"2025-08-01","pagenumber":"1","pagesize":"2","campaignid":"CMP1CON1"} // this will return all recipients that have engagement on the specified date in the specified campaign Example: {"date":"2025-08-01","pagenumber":"1","pagesize":"10","sortby":"Campaign ID"} // this will return all recipients that have engagement on the specified date sort by campaign ID Example: {"date":"2025-08-01","pagenumber":"1","pagesize":"10","sortby":"Campaign ID","sortorder":"desc"} // this will return all recipients that have engagement on the specified date sort by campaign ID in descending order Example: {"date":"2025-08-01","pagenumber":"1","pagesize":"2","sortby":"Campaign ID","sortorder":"desc", "emailaddress":"john.doe@example.co.uk"} // this will return specific recipient's engagement on the specified date sort by campaign ID in descending order - Successful Response – 200 OK
-
{ "Total Record(s)": "5", "Results": [ { "Recipient ID": "RCP1I1O1", "Email Address": "john.doe@example.co.uk", "Campaign ID": "CMP1CON2", "Campaign Name": "Campaign Test 1", "Sent Date": "15/08/2025 11:05", "Opens": 3, "Clicks": 0, "Forwards": 0, "Unsubscribe": "No", "Unsubscribe Date": "", "Pause": "No", "Pause Date": "", "Soft Bounce": "No", "Hard Bounce": "No", "Bounce Date": "" }, { "Recipient ID": "RCP2I1O1", "Email Address": "abc.xyz@example.co.uk", "Campaign ID": "CMP1CON2", "Campaign Name": "Campaign Test 1", "Sent Date": "15/08/2025 11:05", "Opens": 2, "Clicks": 0, "Forwards": 0, "Unsubscribe": "No", "Unsubscribe Date": "", "Pause": "No", "Pause Date": "", "Soft Bounce": "No", "Hard Bounce": "No", "Bounce Date": "" }, { "Recipient ID": "RCP2I1O1", "Email Address": "abc.xyz@example.co.uk", "Campaign ID": "CMP2CON8", "Campaign Name": "Campaign Test 3", "Sent Date": "20/08/2025 11:53", "Opens": 1, "Clicks": 0, "Forwards": 0, "Unsubscribe": "No", "Unsubscribe Date": "", "Pause": "No", "Pause Date": "", "Soft Bounce": "No", "Hard Bounce": "No", "Bounce Date": "" }, { "Recipient ID": "RCP1I1O1", "Email Address": "john.doe@example.co.uk", "Campaign ID": "CMP2CON8", "Campaign Name": "Campaign Test 3", "Sent Date": "20/08/2025 11:53", "Opens": 1, "Clicks": 0, "Forwards": 0, "Unsubscribe": "No", "Unsubscribe Date": "", "Pause": "No", "Pause Date": "", "Soft Bounce": "No", "Hard Bounce": "No", "Bounce Date": "" }, { "Recipient ID": "RCP1I1O1", "Email Address": "test@example.com", "Campaign ID": "CMP4CON18", "Campaign Name": "Email Testing", "Sent Date": "22/08/2025 09:36", "Opens": 1, "Clicks": 0, "Forwards": 0, "Unsubscribe": "No", "Unsubscribe Date": "", "Pause": "No", "Pause Date": "", "Soft Bounce": "No", "Hard Bounce": "No", "Bounce Date": "" } ] }
Note: By default the results are returned in ascending order of the account’s primary key.
Supported method: Post
Details
Following should be passed in request body as JSON as shown below:
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/recipientengagementbydate")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""date"":""2025-09-03"",""pagenumber"":""1"",""pagesize"":""5""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/recipientengagementbydate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"date":"2025-08-28","pagenumber":"1","pagesize":"5"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Database
This section outlines all API endpoints which allow you to manage custom fields and global suppression within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/database/customfieldadd
- {{apiurl}}/api/{{api-version}}/database/databasefielddelete/{{DatabasefieldId}}
- {{apiurl}}/api/{{api-version}}/database/databasefieldsfetch
- {{apiurl}}/api/{{api-version}}/database/globalsuppressionlistfetch
- {{apiurl}}/api/{{api-version}}/database/suppressrecipientglobally
Create a database field
Create a custom database field in CM Email Marketing platform. Below table shows parameters that are required and optional in this API call.| Parameter Name | Description |
|---|---|
| FieldName | This parameter value is required. We recommend to avoid using any special characters |
| FieldDescription | This parameter value is optional |
| FieldType | In this parameter value, you’ll define the type of field that you are going to create e.g text box, check box etc. This is required and valid values are (CheckBox/ TextBox/ DateField/ Password/ CommentBox/ Number/ RadioButton/ SelectionBox/ Hidden) |
| HoverText | Optional |
| TextTransformation | Optional – valid values are (TitleCase/ Uppercase/ LowerCase) |
| Required | Optional – valid values are (0 or 1). By default it is 0 |
| Exportable | Optional – valid values are (0 or 1). By default it is 0 |
| DefaultValue | Required only if “Required” parameter is 1 or FieldType is hidden |
| MaxLength | This is max character length that can be defined for a field. Required for (TextBox/ CommentBox/ Number/ RadioButton/ SelectionBox). The value should be between 1 – 2000 characters |
| ListValues | Required for (RadioButton or SelectionBox) – Atleast two list values required. We recommend to avoid using any special characters |
Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/database/databasefieldadd
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
//CheckBox {"FieldType":"CheckBox","FieldName":"CheckBox Field1","FieldDescription":"Some Field Description"} //TextBox {"FieldType":"TextBox","FieldName":"TextBox Field1","FieldDescription":"Some Field Description","MaxLength":255} //DateField {"FieldType":"DateField","FieldName":"DateField Field1","FieldDescription":"Some Field Description"} //RadioButton {"FieldType":"RadioButton","FieldName":"RadioButton Field1","FieldDescription":"Some Field Description","MaxLength":50,"ListValues":[{"DisplayText":"A","DisplayValue":"A"},{"DisplayText":"B","DisplayValue":"B"}]} //SelectionBox {"FieldType":"SelectionBox","FieldName":"SelectionBox Field1","FieldDescription":"Some Field Description","MaxLength":50,"ListValues":[{"DisplayText":"A","DisplayValue":"A"},{"DisplayText":"B","DisplayValue":"B"}]}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "FieldID": "FG2T4I45E", "FieldName": "SelectionBox Field1", "FieldDescription": "Some Field Description", "FieldType": "SELECTIONBOX", "MaxLength": "50", "DefaultValue": null }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/database/databasefieldadd");
var request = new RestRequest(Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
request.AddHeader("Content-Type", "application/json");
var body = @"{""FieldType"":""SelectionBox"",""FieldName"":""SelectionBox Field1"",""FieldDescription"":""Some Field Description"",""MaxLength"":50,""ListValues"":[{""DisplayText"":""A"",""DisplayValue"":""A""},{""DisplayText"":""B"",""DisplayValue"":""B""}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/database/databasefieldadd');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FieldType":"SelectionBox","FieldName":"SelectionBox Field1","FieldDescription":"Some Field Description","MaxLength":50,"ListValues":[{"DisplayText":"A","DisplayValue":"A"},{"DisplayText":"B","DisplayValue":"B"}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a custom field
This endpoint will delete a custom field based on a custom field id.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/database/databasefielddelete/{{DatabasefieldId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/database/databasefielddelete/{{DatabasefieldId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Custom field deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/database/databasefielddelete/{{DatabasefieldId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/database/databasefielddelete/{{DatabasefieldId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Database Fields
Fetch database fields information from your CM Email Marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/database/databasefieldsfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "26", "Results": [ { "ID": "FG1T1I1E", "Name": "Email Address", "Description": "The recipients email address", "FieldType": "Text Box", "DataType": "Text", "Required": "Yes", "Exportable": "Yes", "DefaultValue": "", "MaxLength": "255", "CreatedDateTime": "13/10/2022 13:27", "ModifiedDateTime": "13/10/2022 13:27", "CreatedBy": "", "ModifiedBy": "" }, { "ID": "FG1T2I2E", "Name": "Active", "Description": "The recipient can be either active or not. Inactive recipients will not receive campaign sends", "FieldType": "Checkbox", "DataType": "Boolean", "Required": "Yes", "Exportable": "Yes", "DefaultValue": "Yes", "MaxLength": "5", "CreatedDateTime": "13/10/2022 13:27", "ModifiedDateTime": "13/10/2022 13:27", "CreatedBy": "", "ModifiedBy": "" } ] }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/database/databasefieldsfetch");
var request = new RestRequest(Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/database/databasefieldsfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get global suppression list
This will return all the recipients who have been suppressed in your account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/database/globalsuppressionlistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "3", "Results": [ { "SuppressedAddress": "example1@123.com", "SuppressedVIA": "Manual", "SuppressedBy": "User 1", "DateSuppressed": "24/08/2023 10:54" }, { "SuppressedAddress": "example2@123.com", "SuppressedVIA": "API", "SuppressedBy": "API User", "DateSuppressed": "24/08/2023 10:55" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var client = new RestClient("/api/{{APIVERSION}}/database/globalsuppressionlistfetch");
var request = new RestRequest(Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/database/globalsuppressionlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Suppress recipient globally
This endpoint will suppress a recipient globally.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/database/suppressrecipientglobally
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"EmailAddress":"recipient1@example.com"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient suppressed successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/database/suppressrecipientglobally")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/database/suppressrecipientglobally');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Data Capture Form
This section outlines all API endpoints which allow you to manage data capture forms within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/datacaptureform/getadhocfieldsbydcformid
- {{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}
- {{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformresults
- {{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureforms
Get adhoc fields
This endpoint will allow you to fetch adhoc fields based on data capture form id into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getadhocfieldsbydcformid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"DCFormID":"FRM10003T3CON1168","PageNumber":"1","PageSize":"10"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "3", "Results": [ { "DCFormID": "FRM10003T3CON1168", "AdhocFieldID": "1I9E", "AdhocFieldName": "Last Name", "AdhocFieldType": "TextBox", "Required": "No" }, { "DCFormID": "FRM10003T3CON1168", "AdhocFieldID": "1I2E", "AdhocFieldName": "EmailAddress", "AdhocFieldType": "TextBox", "Required": "Yes" }, { "DCFormID": "FRM10003T3CON1168", "AdhocFieldID": "1I1E", "AdhocFieldName": "First Name", "AdhocFieldType": "TextBox", "Required": "No" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getadhocfieldsbydcformid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""DCFormID"":""FRM10T3CON49"",""PageNumber"":""1"",""PageSize"":""30""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getadhocfieldsbydcformid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"DCFormID":"FRM10T3CON49","PageNumber":"1","PageSize":"30"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get DC forms by id
This endpoint will fetch the details of data capture form based on data capture forms by id into your CM email marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "DataCaptureFormID": "FRM10003T3CON1168", "DataCaptureFormName": "Personalisation Testing", "PageTitle": "Personalisation Testing", "EditorType": "Drag & Drop Editor", "RedirectUrl": "", "DateStatus": "No", "StartDate": "", "EndDate": "", "DataCaptureUrl": "https://devssl.cmadvantage.co.uk/CDD3841028-Z-Z-7-Z-0-3-FRM10003T3CON1168-0-0-Z-Z-Z-Z-Z-Z" }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get DC form Results
This endpoint will fetch the results of data capture form based on data capture form id into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformresults
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"DCFormID":"FRM10003T3CON1168","StartDate":"2023-05-01","EndDate":"2023-05-04"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Results": [ { "First Name": "recipient1", "Email Address": "recipient1@example.com", "Occured At": "02/05/2023 12:13:20" }, { "First Name": "recipient2", "Email Address": "recipient2@example.com", "Occured At": "02/05/2023 12:13:12" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformresults")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""DCFormID"":""FRM10T3CON49"",""StartDate"":""2023-05-01"",""EndDate"":""2024-05-04""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformresults');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"DCFormID":"FRM10T3CON49","StartDate":"2023-05-01","EndDate":"2024-05-04"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get DC forms
This endpoint will fetch the data capture forms into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureforms
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"Pagenumber":"1","PageSize":"1"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "DataCaptureFormID": "FRM10003T3CON1168", "DataCaptureFormName": "test form", "PageTitle": "test form", "EditorType": "Drag & Drop Editor", "RedirectUrl": "", "DateStatus": "No", "StartDate": "", "EndDate": "", "DataCaptureUrl": "https://devssl.cmadvantage.co.uk/CDD3841028-Z-Z-7-Z-0-3-FRM10003T3CON1168-0-0-Z-Z-Z-Z-Z-Z" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureforms")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Pagenumber"":""1"",""PageSize"":""10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureforms');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Pagenumber":"1","PageSize":"10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Email Alias
This section outlines all API endpoints which allow you to manage email aliases within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressadd
- {{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressdelete/{{AliasId}}
- {{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressedit
- {{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddresslist
Add redirect email
This endpoint will allow you to add a redirect email address into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressadd
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddress":"recipient@example.com"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Redirect email added successfully." }
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressadd")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromAddressName"":""recipient@example.com"",""FromAddressDomain"":""testing.example.com"",""RedirectEmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressadd');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromAddressName":"recipient@example.com","FromAddressDomain":"testing.example.com","RedirectEmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete redirect email
This endpoint will delete a redirect email address based on a redirect email address id into your CM email marketing account.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressdelete/{{AliasId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressdelete/{{AliasId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Email alias deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressdelete/{{AliasId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressdelete/{{AliasId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update redirect email
This endpoint will allow you to update an existing redirect email address into your CM email marketing account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressedit
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddress":"recipient1@example.com","RedirectEmailAddressID":"11"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Redirect email updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressedit")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromAddressName"":""recipient"",""FromAddressDomain"":""example.com"",""RedirectEmailAddressID"":""7""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddressID":"7"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get redirect email
This endpoint will fetch all redirect email address into your CM email marketing account.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/emailalias/redirectemailaddresslist
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": [ { "RedirectEmailID": "2", "RedirectEmailAddress": "recipient@example.com", "FromAddress": "recipient", "DomainName": "domain.example.com", "CreatedDate": "21/04/2023 15:51" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddresslist")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddresslist');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Jobs
This section outlines all API endpoints which allow you to manage Jobs within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/jobs/jobdelete
- {{apiurl}}/api/{{api-version}}/jobs/jobdetailsfetchbyid/{{JobID}}
- {{apiurl}}/api/{{api-version}}/jobs/joblistforcampaignschedulefetch
- {{apiurl}}/api/{{api-version}}/jobs/joblistforrecipientsimportfetch
- {{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimport
- {{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportwithdelimiter
- {{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}
- {{apiurl}}/api/{{api-version}}/jobs/jobrecipientsglobalsuppression
Delete a job
This endpoint will delete a job based on a job id.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/jobs/jobdelete/{{JobId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/jobs/jobdelete/{{JobId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobdelete/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobdelete/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get job details by job Id
This endpoint will fetch the details of a job by job Id.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/jobs/jobdetailsfetchbyid/{{JobID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/jobs/jobdetailsfetchbyid/{{JobID}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Results": { "JobID": "58182", "JobType": "Recipients Import", "FileName": "import_rejected_test.txt", "ListName": "User 1 - List 2 - Deleted on 17/08/2023 by super super", "Status": "Successful", "QueuedAt": "16/08/2023 16:43", "StartDateTime": "16/08/2023 16:43", "EndDateTime": "16/08/2023 16:43", "A.TotalInserted": "0", "B.TotalUpdated": "0", "C.TotalRejected": "1", "D.TotalDuplicates": "0", "TotalImported(A+B)": "0", "TotalRecipients(A+B+C+D)": "1" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobdetailsfetchbyid/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobdetailsfetchbyid/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get scheduled campaign jobs
This endpoint will fetch all jobs that relate to scheduled campaigns.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/jobs/joblistforcampaignschedulefetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "228", "Results": [ { "JobID": "58552", "JobType": "Resend to Non-Opens", "ScheduledFor": "31/08/2023 00:00:00", "Name": "Resend Non Open Subject - Resend to Non-Opens", "Status": "Successful", "QueuedAt": "30/08/2023 14:58", "StartDateTime": "31/08/2023 00:00", "EndDateTime": "31/08/2023 00:00", "TotalMessage(s)Sent": "1" }, { "JobID": "58551", "JobType": "Regular Campaign Launch", "Name": "Resend Non Open Subject", "Status": "Successful", "QueuedAt": "30/08/2023 14:58", "StartDateTime": "30/08/2023 14:58", "EndDateTime": "30/08/2023 14:58", "TotalMessage(s)Sent": "1" }, { "JobID": "11424", "JobType": "Regular Campaign Launch", "Name": "Campaign 1", "Status": "Successful", "QueuedAt": "11/04/2022 12:57", "StartDateTime": "11/04/2022 12:57", "EndDateTime": "11/04/2022 12:57", "TotalMessage(s)Sent": "3" } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/joblistforcampaignschedulefetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/joblistforcampaignschedulefetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get import recipients jobs
This endpoint will fetch a list of all jobs that relate to recipient imports.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/jobs/joblistforrecipientsimportfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "JobID": "58182", "JobType": "Recipients Import", "FileName": "import_rejected_test.txt", "ListName": "User 1 - List 2 - Deleted on 17/08/2023 by super super", "Status": "Successful", "QueuedAt": "16/08/2023 16:43", "StartDateTime": "16/08/2023 16:43", "EndDateTime": "16/08/2023 16:43", "A.TotalInserted": "0", "B.TotalUpdated": "0", "C.TotalRejected": "1", "D.TotalDuplicates": "0", "TotalImported(A+B)": "0", "TotalRecipients(A+B+C+D)": "1" }, { "JobID": "11421", "JobType": "Recipients Import", "FileName": "Import.csv", "ListName": "Import List", "Status": "Successful", "QueuedAt": "11/04/2022 12:40", "StartDateTime": "11/04/2022 12:40", "EndDateTime": "11/04/2022 12:40", "A.TotalInserted": "3", "B.TotalUpdated": "0", "C.TotalRejected": "0", "D.TotalDuplicates": "0", "TotalImported(A+B)": "3", "TotalRecipients(A+B+C+D)": "3" } ] }
Example Request
var options = new RestClientOptions("{{api-url}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/jobs/joblistforrecipientsimportfetch", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/joblistforrecipientsimportfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Import recipients
This endpoint will import recipients data.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimport
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ListID": "EL3CUI494", "FileName": "APII.csv", "UseDefaultSetting" : "TRUE", "Data": [ "EmailAddress,First Name ", "recipient1@recipientjobimport.com,recipient1\r\nrecipient2@recipientjobimport.com,recipient2" ] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "JobID": "56042", "Message": "Job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/JobRecipientsImport")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{
" + "\n" +
@" ""ListID"": ""EL3CUI494"",
" + "\n" +
@" ""FileName"": ""APII.csv"",
" + "\n" +
@" ""UseDefaultSetting"" : ""TRUE"",
" + "\n" +
@" ""Data"": [
" + "\n" +
@" ""EmailAddress,First Name "",
" + "\n" +
@" ""recipient1@recipientjobimport.com,recipient1""
" + "\n" +
@" ]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/JobRecipientsImport');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "ListID": "EL3CUI494",
\n "FileName": "APII.csv",
\n "UseDefaultSetting" : "TRUE",
\n "Data": [
\n "EmailAddress,First Name ",
\n "recipient1@recipientjobimport.com,recipient1"
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Import recipients using delimiter
This endpoint will import recipients data using a delimiter such as “,” or “|”.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportwithdelimiter
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ListID": "EL3CUI494", "FileName": "SQLAPI.csv", "UseDefaultSetting": "TRUE", "Delimiter": ",", "Data": [ "EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2", "recipient1@recipientjobimport.com,779412345627,recipient1,null, null", "recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1" ] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "JobID": "56042", "Message": "Job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/JobRecipientsImportWithDelimiter")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{
" + "\n" +
@" ""ListID"": ""EL3CUI494"",
" + "\n" +
@" ""FileName"": ""SQLAPI.csv"",
" + "\n" +
@" ""UseDefaultSetting"": ""TRUE"",
" + "\n" +
@" ""Delimiter"": "","",
" + "\n" +
@" ""Data"": [
" + "\n" +
@" ""EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2"",
" + "\n" +
@" ""recipient1@recipientjobimport.com,779412345627,recipient1,null, null"",
" + "\n" +
@" ""recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1""
" + "\n" +
@" ]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/JobRecipientsImportWithDelimiter');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "ListID": "EL3CUI494",
\n "FileName": "SQLAPI.csv",
\n "UseDefaultSetting": "TRUE",
\n "Delimiter": ",",
\n "Data": [
\n "EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2",
\n "recipient1@recipientjobimport.com,779412345627,recipient1,null, null",
\n "recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1"
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get import recipients job details
This endpoint will fetch a list of all the recipients imported in the most recent job.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "RecipientID": "RCP2I130234O743", "EmailAddress": "recipient1@recipientjobimport.com", "ImportStatus": "Add", "ModifiedDate": "11/01/2024 " }, { "RecipientID": "RCP2I130235O743", "EmailAddress": "recipient2@recipientjobimport.com", "ImportStatus": "Add", "ModifiedDate": "11/01/2024 " } ] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Import recipients global suppression
This endpoint imports recipients into the global suppression list. The uploaded data must contain only one column with email addresses, and no column header is required.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsglobalsuppression
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "FileName": "APII.csv", "Data": ["recipient1@recipientjobimport.com","recipient2@recipientjobimport.com"] }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "JobID": "56042", "Message": "Job created successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobrecipientsglobalsuppression")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{
" + "\n" +
@" ""FileName"": ""APII.csv"",
" + "\n" +
@" ""Data"": [
" + "\n" +
@" ""recipient1@recipientjobimport.com"",""recipient2@recipientjobimport.com""
" + "\n" +
@" ]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobrecipientsglobalsuppression');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "FileName": "APII.csv",
\n "Data": [
\n "recipient1@recipientjobimport.com","recipient2@recipientjobimport.com"
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Lists
This section outlines all API endpoints which allow you to manage Lists within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/lists/listfetch
- {{apiurl}}/api/{{api-version}}/lists/listcreate
- {{apiurl}}/api/{{api-version}}/lists/listedit
- {{apiurl}}/api/{{api-version}}/lists/listdelete/{{ListId}}
- {{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/{{ListId}}
- {{apiurl}}/api/{{api-version}}/lists/listempty
Fetch lists
Fetch lists from your CM Email Marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/lists/listfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "ID": "ABC123", "ListName": "Marketing", "ListDescription": "Marketing list.", "TotalCount": "100", "CreatedDate": "13/12/2022 11:22", "ModifiedDate": "23/08/2023 15:11" }, ] }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/lists/listfetch");
var request = new RestRequest(Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/lists/listfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Create a list
This endpoint will allow you to create a list in your CM Email Marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/lists/listcreate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ListName":"Marketing List", "ListDescription":"Created through API." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "ID": "ABCD1234", "ListName": "Marketing List", "ListDescription": "Created through API.", "TotalCount": "0", "CreatedDate": "19/09/2023 03:52", "ModifiedDate": "19/09/2023 03:52" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/lists/listcreate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ListName"":""Marketing List"",""ListDescription"":""Created through API.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/lists/listcreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ListName":"Marketing List","ListDescription":"Created through API."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Edit a list
This endpoint will allow you to edit a list in your CM Email Marketing account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/lists/listedit
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ListID": "ABCD1234", "ListName":"Marketing List", "ListDescription":"Created through API." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "List updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/lists/listedit", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ListID"": ""EL34CUI241"",""ListName"":""Marketing List"",""ListDescription"":""Updated through API.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/lists/listedit');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ListID": "EL34CUI241","ListName":"Marketing List","ListDescription":"Updated through API."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a list
This endpoint will allow you to delete a list from your CM Email Marketing account. Recipients that are part of this list will not be deleted from your account.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/lists/listdelete/{{ListId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/lists/listdelete/ABCD1234
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "List deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/lists/listdelete/ABCD1234", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/lists/listdelete/ABCD1234');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a list with recipients
This endpoint will allow you to delete a list along with recipients from your CM Email Marketing account. Recipients that are part of this list will be deleted permanently from your account and this action is not recoverable. Moreover, you’ll lose campaign history for these recipients.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/{{ListId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/ABCD1234
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "List deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/lists/listdeletewithrecipients/ABCD1234", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/lists/listdeletewithrecipients/ABCD1234');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Empty a list
This endpoint will allow you to empty a list in your CM Email Marketing account. Any recipient attached to this list will be unassigned. Please ensure that you have assigned recipients to another list before emptying a list.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/lists/listempty
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ListID": "ABCD1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient(s) deleted from the list successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/lists/listempty", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ListID"": ""ABCD1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/lists/listempty');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ListID": "ABCD1234"}')
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Recipients
This section outlines all API endpoints which allow you to manage Recipients within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/recipients/getrecipients
- {{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyemailaddress
- {{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyrecipientid
- {{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid{{ListId}}
- {{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid{{RecipientId}}
- {{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory{{RecipientId}}
- {{apiurl}}/api/{{api-version}}/recipients/addrecipient
- {{apiurl}}/api/{{api-version}}/recipients/addorupdaterecipient
- {{apiurl}}/api/{{api-version}}/recipients/addrecipientstolists
- {{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyemailaddress
- {{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyrecipientid
- {{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyemailaddress
- {{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyrecipientid
- {{apiurl}}/api/{{api-version}}/recipients/recipientdeletebyemailaddress
- {{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
- {{apiurl}}/api/{{api-version}}/recipients/removerecipientfromlist
- {{apiurl}}/api/{{api-version}}/recipients/removerecipientsfromlists
- {{apiurl}}/api/{{api-version}}/recipients/recipientglobalsuppressionbyemailaddress
Get recipients
Get recipients CM Email Marketing account using a PageNumber, PageSize and Criteria parameters in the request body. All these parameters are required to fetch recipients from CM Email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/getrecipients
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "PageNumber":1,"PageSize":100, "Criteria":[{ "FieldName":"Email Address", "Operator":"contains", "FieldValue":"example", "LogicalOperator":"or", "LeftParentheses":false, "RightParentheses":false }] }
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "ID": "RCP22I89O241", "EmailAddress": "example2@dummyemail.com", "Active": "Yes", "Verified": "No", "EmailContentType": "HTML", "CreatedDate": "24/08/2023", "ModifiedDate": "24/08/2023" }, { "ID": "RCP28I91O241", "EmailAddress": "example@dummyemail.com", "Active": "Yes", "Verified": "Yes", "EmailContentType": "MultiPart", "CreatedDate": "06/09/2023", "ModifiedDate": "06/09/2023" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/getrecipients", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""PageNumber"":1,""PageSize"":100,""Criteria"":[{""FieldName"":""Email Address"",""Operator"":""contains"",""FieldValue"":""example"",""LogicalOperator"":""or"",""LeftParentheses"":false,""RightParentheses"":false}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/getrecipients');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"PageNumber":1,"PageSize":100,"Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"example","LogicalOperator":"or","LeftParentheses":false,"RightParentheses":false}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get recipient information by Email
Get recipient information from your CM Email Marketing account using an EmailAddress parameter in the request body. If you want the values of the specific database fields then you can pass the optional parameter DatabaseFields in this call.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
// Sample JSON body 1: {"EmailAddress" :"example@dummyemail.com"} // Sample JSON body 2: {"EmailAddress" :"example@dummyemail.com","DatabaseFields":["First Name","Last Name"]}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
// Sample Result 1: { "Results": [ { "FieldName": "ID", "FieldValue": "ABC1234" }, { "FieldName": "Email Address", "FieldValue": "example@dummyemail.com" }, { "FieldName": "Active", "FieldValue": "Yes" }, { "FieldName": "Verified", "FieldValue": "No" }, { "FieldName": "Email Content Type", "FieldDisplayText": "HTML", "FieldValue": "2" }, { "FieldName": "Created Date", "FieldValue": "06/09/2023 17:40" }, { "FieldName": "Modified Date", "FieldValue": "18/09/2023 16:23" }, { "FieldName": "Newsletter Subscription", "FieldValue": "No" }, { "FieldName": "First Name", "FieldValue": "John" }, { "FieldName": "Last Name", "FieldValue": "Doe" }, { "FieldName": "membership", "FieldDisplayText": null, "FieldValue": null }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" } ] } // Sample Result 2: { "Results": [ { "FieldName": "ID", "FieldValue": "ABC1234" }, { "FieldName": "First Name", "FieldValue": "John" }, { "FieldName": "Last Name", "FieldValue": "Doe" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/recipientinformationfetchbyemailaddress", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"" :""example@dummyemail.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress" :"example@dummyemail.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get recipient information by Id
Get recipient information from your CM Email Marketing account using an RecipientId parameter in the request body. If you want the values of the specific database fields then you can pass the optional parameter DatabaseFields in this call.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyrecipientid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
//Sample JSON body 1: {"RecipientID" :"ABC1234"} //Sample JSON body 2: {"RecipientID" :"ABC1234","DatabaseFields":["First Name","Last Name"]}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
// Sample Result 1: { "Results": [ { "FieldName": "ID", "FieldValue": "ABC1234" }, { "FieldName": "Email Address", "FieldValue": "example@dummyemail.com" }, { "FieldName": "Active", "FieldValue": "Yes" }, { "FieldName": "Verified", "FieldValue": "No" }, { "FieldName": "Email Content Type", "FieldDisplayText": "HTML", "FieldValue": "2" }, { "FieldName": "Created Date", "FieldValue": "06/09/2023 17:40" }, { "FieldName": "Modified Date", "FieldValue": "18/09/2023 16:23" }, { "FieldName": "Newsletter Subscription", "FieldValue": "No" }, { "FieldName": "First Name", "FieldValue": "John" }, { "FieldName": "Last Name", "FieldValue": "Doe" }, { "FieldName": "membership", "FieldDisplayText": null, "FieldValue": null }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" } ] } //Sample Result 2: { "Results": [ { "FieldName": "ID", "FieldValue": "ABC1234" }, { "FieldName": "First Name", "FieldValue": "John" }, { "FieldName": "Last Name", "FieldValue": "Doe" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/recipientinformationfetchbyrecipientid", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""RecipientID"" :""ABC1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyrecipientid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"RecipientID" :"ABC1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Recipients by ListId
Get recipients from a list using ListId in the request body. ListId is required to fetch recipients from CM Email marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/{{ListId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/ABCD1234
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "7", "Results": [ { "ID": "RCP28I91O241", "EmailAddress": "example@dummyemail.com", "Active": "Yes", "Verified": "Yes", "EmailContentType": "MultiPart", "CreatedDate": "06/09/2023", "ModifiedDate": "06/09/2023" }, { "ID": "RCP22I89O241", "EmailAddress": "example2@dummyemail.com", "Active": "Yes", "Verified": "No", "EmailContentType": "HTML", "CreatedDate": "24/08/2023", "ModifiedDate": "24/08/2023" } }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/getrecipientsbylistid/{{ListId}}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/{{ListId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get lists for a recipient by RecipientId
Get all lists that a recipient has been assigned to using RecipientId in the request URL. RecipientId is required for this call.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid/{{RecipientId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid/ABC123
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Results": { "EmailAddress": "example@dummyemail.com", "ExternalID": "ABC123", "RecipientLists": [ { "ListID": "ABCD1234", "ListName": "API LIST 1" }, { "ListID": "ABCD4567", "ListName": "API LIST 2" } ] } }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientlistsbyrecipientid/ABC123", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientlistsbyrecipientid/ABC123');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get campaign history for a recipient by RecipientId
This call will return campaign history for a recipient. RecipientId is required for this call.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory/{{RecipientId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory/ABC123
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Results": { "RecipientID": "ABC123", "EmailAddress": "example@dummyemail.com", "RecipientCampaignSentHistory": [ { "CampaignID": "CMP196CON216", "CampaignName": "Example Campaign 1", "CampaignDescription": "Example Campaign 1", "CampaignRecievedDate": "17/09/2023 19:45", "CampaignOpens": "1", "CampaignClicks": "0", "CampaignForwards": "0", "CampaignUnsubscribes": "No", "HardBounce": "No", "SoftBounce": "No", "FirstTimeOpened": "18/09/2023 03:40:01", "LastTimeOpened": "18/09/2023 03:40:01", "FirstTimeClicked": "", "LastTimeClicked": "" }] } }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientcampaignshistory/ABC123", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientcampaignshistory/ABC123');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add a recipient
Add a recipient in CM Email Marketing platform using an EmailAddress and ListID in the request. ListID is optional and Multiple List ID’s can be passed in the body of the request by comma separation. If a ListID is not passed or set to blank in the request body then a recipient will be added to database but it’ll not be visible or assigned to any lists. We recommend to always add ListID in this call.List ID’s can be fetched using listfetch api call in the Lists section of this document.
Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/addrecipient
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "EmailAddress": "example@dummyemail.com", "ListID": ["ABC123","ABC456"] }
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "ListID": "ABC123", "RecipientID": "ABC1234", "EmailAddress": "example@dummyemail.com", "Status": "OK", "StatusMessage": "Recipient added successfully." }, { "ListID": "ABC456", "RecipientID": "ABC1234", "EmailAddress": "example@dummyemail.com", "Status": "OK", "StatusMessage": "Recipient added successfully." },
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/recipients/addrecipient");
var request = new RestRequest(Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
request.AddHeader("Content-Type", "application/json");
var body =
var body = @"{
" + "\n" +
@" ""EmailAddress"": ""example@dummyemail.com"",
" + "\n" +
@" ""ListID"": [""ABC123""]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/addrecipient');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "EmailAddress": "example@dummyemail.com",
\n "ListID": ["ABC123"]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add or update a recipient
Add or update a recipient in CM Email Marketing platform using an EmailAddress, RecipientID(optional but required in case of updating a recipient), ListID(optional but recommended) and CustomFields(optional) in the request. If a RecipientID is passed in the request body then this call will update existing recipient using RecipientID. If a RecipientID is not passed then a new Recipient will be added in the database if it does not exist. If an EmailAddress exists in the database then an error will be thrown saying that “Emailaddress already exists.” In order to update a recipient in CM Email Marketing a RecipientID must be passed in the body of the request. ListID is optional and Multiple List ID’s can be passed in the body of the request by comma separation. If a ListID is not passed or set to blank in the request body then a recipient will be added to database but it’ll not be visible or assigned to any lists. We recommend to always add ListID in this call. CustomFields is optional.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/addorupdaterecipient
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
//Adding a Recipient - RecipientID is not passed in this case. { "EmailAddress": "example@dummyemail.com", "Lists": [ "ABC123", "ABC456" ], "CustomFields": [ { "FieldName": "first name", "FieldValue": "John" }, { "FieldName": "last name", "FieldValue": "Doe" }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" }, { "FieldName": "uk resident", "FieldValue": "n" }, { "FieldName": "favourite color", "FieldValue": "g" }, { "FieldName": "Active", "FieldValue": "0" }, { "FieldName": "verified", "FieldValue": "1" }, { "FieldName": "Email Content Type", "FieldValue": "3" }, { "FieldName": "Account number", "FieldValue": "2120" } ] } //Updating a Recipient - RecipientID is passed in this case to update that Recipient. { "EmailAddress": "example@dummyemail.com", "RecipientID": "ABC1234", "Lists": [ "ABC123", "ABC456" ], "CustomFields": [ { "FieldName": "first name", "FieldValue": "John" }, { "FieldName": "last name", "FieldValue": "Doe" }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" }, { "FieldName": "uk resident", "FieldValue": "n" }, { "FieldName": "favourite color", "FieldValue": "g" }, { "FieldName": "Active", "FieldValue": "0" }, { "FieldName": "verified", "FieldValue": "1" }, { "FieldName": "Email Content Type", "FieldValue": "3" }, { "FieldName": "Account number", "FieldValue": "2120" } ] }
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "RecipientID": "ABC1234", "EmailAddress": "example@dummyemail.com", "StatusMessage": "Recipient added successfully." }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/recipients/addrecipient");
var request = new RestRequest(Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
request.AddHeader("Content-Type", "application/json");
var body =
var body = @"{
" + "\n" +
@" ""EmailAddress"": ""example@dummyemail.com"",
" + "\n" +
@" ""ListID"": [""ABC123""]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/addrecipient');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "EmailAddress": "example@dummyemail.com",
\n "ListID": ["ABC123"]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add recipients to lists
Add a single or multiple recipient(s) to a single or multiple list(s). RecipientID and ListID is required for this request. Supported method:POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/addrecipientstolists
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
//Adding a single or multiple recipient(s) to a single or multiple list(s). { "Recipients": [ { "RecipientID": "ABC1234" }, { "RecipientID": "ABC5678" } ], "Lists": [ { "ListID": "ABC123" }, { "ListID": "ABC456" } ] }
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient added to list(s) successfully." }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/recipients/addrecipientstolists");
var request = new RestRequest(Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
request.AddHeader("Content-Type", "application/json");
var body =
var body = @"{""Recipients"":[{""RecipientID"":""ABC1234""},{""RecipientID"":""ABC5678""}],""Lists"":[{""ListID"":""ABC123""},{""ListID"":""ABC456""}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/addrecipientstolists');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Recipients":[{"RecipientID":"ABC1234"},{"RecipientID":"ABC5678"}],"Lists":[{"ListID":"ABC123"},{"ListID":"ABC456"}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update recipient information using Emailaddress
This call will update a recipient by passing Emailaddress as a paremeter in request body. You can update custom field information using this call e.g. First Name, Last Name etc. Please ensure that the field names you have passed in the request body of this API call do exist in your CM Email Marketing account. You can use databasefieldsfetch to get fields information in the Database Section of this document. Emailaddress and CustomFields parameters are required to run this request.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{ "EmailAddress": "example@dummyemail.com", "CustomFields": [ { "FieldName": "first name", "FieldValue": "John" }, { "FieldName": "last name", "FieldValue": "Doe" }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" }, { "FieldName": "uk resident", "FieldValue": "yes" }, { "FieldName": "Active", "FieldValue": "1" }] }
This should be passed in the body of a request in JSON format as shown below:
- Successful Response – 200 OK
-
{ "RecipientID": "ABC123", "EmailAddress": "example@dummyemail.com", "CreatedDate": "18/09/2023", "ModifiedDate": "18/09/2023", "Message": "Recipient updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientupdatebyemailaddress", Method.Put);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"": ""example@dummyemail.com"",""CustomFields"": [{""FieldName"": ""first name"",""FieldValue"": ""John""},{""FieldName"": ""last name"",""FieldValue"": ""Doe""}]}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientupdatebyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress": "example@dummyemail.com","CustomFields": [{"FieldName": "first name","FieldValue": "John"},{"FieldName": "last name","FieldValue": "Doe"}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update recipient information using RecipientId
This call will update a recipient by passing RecipientID as a paremeter in request body. You can update custom field information using this call e.g. First Name, Last Name etc. Please ensure that the field names you have passed in the request body of this API call do exist in your CM Email Marketing account. You can use databasefieldsfetch to get fields information in the Database Section of this document. RecipientId and CustomFields parameters are required to run this request.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyrecipientid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{ "RecipientID": "RCP28I91O241", "CustomFields": [ { "FieldName": "first name", "FieldValue": "John" }, { "FieldName": "last name", "FieldValue": "Doe" }, { "FieldName": "Date of Birth", "FieldValue": "13/12/2023" }, { "FieldName": "uk resident", "FieldValue": "yes" }, { "FieldName": "Active", "FieldValue": "1" }] }
This should be passed in the body of a request in JSON format as shown below:
- Successful Response – 200 OK
-
{ "RecipientID": "ABC123", "EmailAddress": "example@dummyemail.com", "CreatedDate": "18/09/2023", "ModifiedDate": "18/09/2023", "Message": "Recipient updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientupdatebyrecipientid", Method.Put);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""RecipientID"": ""ABC1234"",""CustomFields"": [{""FieldName"": ""first name"",""FieldValue"": ""John""},{""FieldName"": ""last name"",""FieldValue"": ""Doe""}]}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientupdatebyrecipientid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"RecipientID": "ABC1234","CustomFields": [{"FieldName": "first name","FieldValue": "John"},{"FieldName": "last name","FieldValue": "Doe"}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update recipient email using EmailAddress
This call will update a recipient email by passing an EmailAddress of an existing recipient as a paremeter in request body. ExistingEmailAddress and NewEmailAddress parameters are required to run this request.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{"ExistingEmailAddress":"example@dummyemail.com","NewEmailAddress":"example123@dummyemail.com"}
This should be passed in the body of a request in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientemailaddresseditbyemailaddress", Method.Put);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ExistingEmailAddress"":""example@dummyemail.com"",""NewEmailAddress"":""example123@dummyemail.com""}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientemailaddresseditbyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ExistingEmailAddress":"example@dummyemail.com","NewEmailAddress":"example123@dummyemail.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update recipient email using RecipientId
This call will update a recipient email by passing a RecipientId of an existing recipient as a paremeter in request body. EmailAddress and RecipientId parameters are required to run this request.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyrecipientid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{"EmailAddress":"example4@dummyemail.com","RecipientID":"ABCD1234"}
This should be passed in the body of a request in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientemailaddresseditbyrecipientid", Method.Put);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"":""example4@dummyemail.com"",""RecipientID"":""ABCD1234""}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientemailaddresseditbyrecipientid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress":"example4@dummyemail.com","RecipientID":"ABCD1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a recipient by EmailAddress
Delete a recipient from your CM Email Marketing account using an EmailAddress parameter in the request body.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletebyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"EmailAddress" :"example@dummyemail.com"}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/recipientdeletebyemailaddress", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"" :""example@dummyemail.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/recipientdeletebyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress" :"example@dummyemail.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a recipient by RecipientId
Delete a recipient from your CM Email Marketing account using an EmailAddress parameter in the request body.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/recipients/recipientdeletefromdatabase/ABCD1234", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/recipients/recipientdeletefromdatabase/{{RecipientId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Remove a single recipient from a list
Remove a recipient from a list in your CM Email Marketing account using an RecipientId and ListId parameters in the request body.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/removerecipientfromlist
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"RecipientID": "ABCD1234","ListID":"ABC123"}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient deleted from the list successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/removerecipientfromlist", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""RecipientID"": ""ABCD1234"",""ListID"":""ABC123""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/removerecipientfromlist');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"RecipientID": "ABCD1234","ListID":"ABC123"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Remove multiple recipient(s) from multiple list(s)
Remove a recipient from a list in your CM Email Marketing account using an RecipientId and ListId parameters in the request body.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/removerecipientsfromlists
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"ListID":["ABC123","XYZ123"],"RecipientID":["ABCD1234","XYZ1234"]}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient(s) deleted from the list(s) successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/removerecipientsfromlists", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ListID"":[""ABC123"",""XYZ123""],""RecipientID"":[""ABCD1234"",""XYZ1234""]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/removerecipientsfromlists');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ListID":["ABC123","XYZ123"],"RecipientID":["ABCD1234","XYZ1234"]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Recipient global suppression by Email
Get globally suppressed recipient information from your CM Email Marketing account using an EmailAddress parameter in the request body.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/recipients/recipientglobalsuppressionbyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"EmailAddress" :"example@dummyemail.com"}
This should be passed in JSON format as shown below:
- Successful Response – 200 OK
-
{ "EmailAddress": "example@dummyemail.com", "RecipientID": "ABC1234", "SuppressedVia": "System", "SuppressedBy": "system", "UnsubscribeReason": "", "CampaignID": "1234", "DateSuppressed": "23/03/2026 14:54" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/recipients/recipientglobalsuppressionbyemailaddress", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{"EmailAddress" :"example@dummyemail.com"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/recipients/recipientglobalsuppressionbyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress":"example@dummyemail.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
SMS Campaigns
This section outlines all API endpoints which allow you to manage SMS campaigns within your CM Email Marketing account:- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignattachlist
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaigncreate
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignedit
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignfetchbyid
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaigngetteststatus
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignlaunchimmediately
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignrecipientreplyfetch
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignreplyoptionsadd
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignschedule
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignsendtest
- {{apiurl}}/api/{{api-version}}/smscampaigns/smscampaigntextget
Get SMS campaign activity
This endpoint will fetch all the activities of the SMS campaigns.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "CampaignID": "CMP162CON1188", "CampaignDescription": "SMS API", "CampaignName": "SMS API", "RecipientSelected": "1", "TotalSMSSent": "1", "FailedMessages": "0", "TotalUnsubscribes": "0", "TotalReplies": "0" }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Attach list to SMS campaign
This endpoint will allow you to attach a list to the SMS campaign in your CM Email Marketing account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignattachlist
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP161CON1187","ListID":"EL1CUI1"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "List attached successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignattachlist")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""ListID"":""EL1CUI1""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignattachlist');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","ListID":"EL1CUI1"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
SMS Campaign Create
This endpoint will create SMS campaign into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaigncreate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"campaignName":"SMS Through API1","campaigndescription":"SMS Through API'"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP161CON1187", "CampaignName": "SMS Through API1", "CampaignDescription": "SMS Through API'", "CreatedDate": "11/05/2023 14:51", "ModifiedDate": "11/05/2023 14:51", "Message": "SMS campaign created successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigncreate")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""campaignName"":""SMS Through API1"",""campaigndescription"":""SMS Through API'""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigncreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"campaignName":"SMS Through API1","campaigndescription":"SMS Through API\'"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Edit SMS campaign
This endpoint will allow you to edit SMS campaign in your CM Email Marketing account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignedit
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP148CON270","validityInHours":"24","CharacterSet":"unicode","AllowExtendedMsg":"0","Message":"Test SMS1"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP161CON1187", "CampaignName": "SMS Through API1", "CampaignDescription": "", "CreatedDate": "11/05/2023 14:51", "ModifiedDate": "11/05/2023 14:52", "Message": "SMS campaign updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignedit")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP148CON270"",""validityInHours"":""24"",""CharacterSet"":""unicode"",""AllowExtendedMsg"":""0"",""Message"":""Test SMS1""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON270","validityInHours":"24","CharacterSet":"unicode","AllowExtendedMsg":"0","Message":"Test SMS1"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get SMS campaign
This endpoint will fetch the details of the SMS campaigns.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": { "CampaignID": "CMP161CON1187", "CampaignName": "SMS Through API1", "CampaignDescription": "SMS Through API'", "CreatedDate": "11/05/2023 14:51", "ModifiedDate": "11/05/2023 14:52", "TextContent": "API SMS", "TemplateID": "", "Validity": "1", "CharacterSet": "1", "AllowExtendedMsg": "False", "ReplyTypeID": null, "ReplyText": null } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get SMS campaign test message status
This endpoint will fetch the last test message status of SMS campaign.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "TestMessageStatus": "Delivery failure - expiration time exceeded" }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Launch SMS campaign immediately
This endpoint will launch SMS campaign immediatly to the attached list into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignlaunchimmediately
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID" : "CMP161CON1187"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign launched successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignlaunchimmediately")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"" : ""CMP161CON1187""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignlaunchimmediately');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID" : "CMP161CON1187"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get SMS campaign recipient replies
This endpoint will fetch all the replies of the SMS campaigns.Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "CampaignID": "CMP162CON1188", "CampaignName": "SMS Through API", "CampaignDescription": "SMS Through API'", "SMSCampaignReplies": [] }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
SMS Campaign reply options add
This endpoint will allow you to add type of reply options of the SMS campaign in your CM Email Marketing account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignreplyoptionsadd
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP161CON1187","ReplyTypeID":"1","ReplyText":"Thank You!"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "CampaignID": "CMP161CON1187", "CampaignName": "SMS Through API1", "CampaignDescription": "", "CreatedDate": "11/05/2023 14:51", "ModifiedDate": "11/05/2023 14:52", "Message": "SMS campaign updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignreplyoptionsadd")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""ReplyTypeID"":""1"",""ReplyText"":""Thank You!""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignreplyoptionsadd');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","ReplyTypeID":"1","ReplyText":"Thank You!"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Schedule SMS campaign
This endpoint will schedule SMS campaign to be sent at a specific date into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignschedule
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID" : "CMP162CON1188","ScheduleDateTime":"2023-05-11 15:10"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Campaign launched successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignschedule")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"" : ""CMP162CON1188"",""ScheduleDateTime"":""2023-05-11 15:10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignschedule');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID" : "CMP162CON1188","ScheduleDateTime":"2023-05-11 15:10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Send SMS campaign test
This endpoint will send out a test message of campaign to specified phone number into your CM email marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignsendtest
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"CampaignID":"CMP161CON1187","TestNumber":"07494186644"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Test sms sent successfully." }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignsendtest")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""TestNumber"":""07412121212""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignsendtest');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","TestNumber":"07494186644"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get SMS campaign body
This endpoint will fetch text body of SMS campaign into your CM email marketing account..Supported method: GET
Details
- Endpoint
- GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaigntextget/{{CampaignId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Results": { "CampaignID": "CMP161CON1187", "CampaignName": "SMS Through API1", "CampaignDescription": "SMS Through API'", "TextContent": "API SMS", "CreatedDate": "11/05/2023 14:51", "ModifiedDate": "11/05/2023 14:52" } }
Example Request
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigntextget/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigntextget/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Templates
This section outlines all API endpoints which allow you to manage templates within your CM Email Marketing account.- {{apiurl}}/api/{{api-version}}/templates/templatelistfetch
- {{apiurl}}/api/{{api-version}}/templates/templatefetchhtmlcontent/{{TemplateId}}
- {{apiurl}}/api/{{api-version}}/templates/templatehtmlcontentbyname
- {{apiurl}}/api/{{api-version}}/templates/templatefetchtextcontent/{{TemplateId}}
- {{apiurl}}/api/{{api-version}}/templates/templatetextcontentbyname
- {{apiurl}}/api/{{api-version}}/templates/templatecategorylistfetch
- {{apiurl}}/api/{{api-version}}/templates/templatecategorycreate
- {{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/{{TemplateCategoryId}}
- {{apiurl}}/api/{{api-version}}/templates/templatecreate
- {{apiurl}}/api/{{api-version}}/templates/templateedit
- {{apiurl}}/api/{{api-version}}/templates/templateaddhtmlcontent
- {{apiurl}}/api/{{api-version}}/templates/templateaddtextcontent
- {{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/{{TemplateId}}
- {{apiurl}}/api/{{api-version}}/templates/templatedelete/{{TemplateId}}
- {{apiurl}}/api/{{api-version}}/templates/sendnotificationemailthroughtemplate
Get templates
Fetch templates from your CM Email Marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/templates/templatelistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "ID": "ABC1234", "Name": "Newsletter Template", "Description": "Newsletter template - Monthly", "CategoryName": "Newsletters", "Tested": "1", "CreatedBy": "User 1", "ModifiedBy": "User 2", "CreatedDate": "23/03/2023 11:09", "ModifiedDate": "13/09/2023 10:41" } ] }
Example Request
var client = new RestClient("{{apiurl}}/api/{{api-version}}/lists/templatelistfetch");
var request = new RestRequest(Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{api-version}}/lists/templatelistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeaders(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get template html content
Fetch HTML content of a template from your CM Email Marketing account. TemplateId is required in the URL of the request.Note:
The response of CMEM API is structured in JSON format, and as a result, double quotes within the response html content are escaped using backslashes to maintain data integrity during the transmission process. It is strongly recommended to remove these backslashes from html content in your JSON response before incorporating it into your application.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/templates/templatefetchhtmlcontent/{{TemplateId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/recipients/templatefetchhtmlcontent/ABCD1234
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "TemplateID": "ABC12345", "HTML Content": "HTML Content of a template." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatefetchhtmlcontent/ABC12345", Method.Get);
request.AddHeader("Authorization", {{token}});
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatefetchhtmlcontent/ABC12345');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get template html content by name
This endpoint will allow you to fetch the html content of a template by providing template name.Note:
The response of CMEM API is structured in JSON format, and as a result, double quotes within the response html content are escaped using backslashes to maintain data integrity during the transmission process. It is strongly recommended to remove these backslashes from html content in your JSON response before incorporating it into your application.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/templates/templatehtmlcontentbyname
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"TemplateName":"TestTemplate"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "TemplateID": "TMP2CON2", "HTML Content": "HTML content of a template" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatehtmlcontentbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateName"":""TestTemplate""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatehtmlcontentbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateName":"TestTemplate"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get template text Content
Fetch TEXT content of a template from your CM Email Marketing account. TemplateId is required in the URL of the request.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/templates/templatefetchtextcontent/{{TemplateId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/recipients/templatefetchtextcontent/ABCD1234
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "TemplateID": "ABC12345", "TEXT Content": "Text Content of a template." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatefetchtextcontent/ABC12345", Method.Get);
request.AddHeader("Authorization", {{token}});
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatefetchtextcontent/ABC12345');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get template text Content by name
This endpoint will allow you to fetch the text content of a template by providing template name.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/templates/templatetextcontentbyname
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"TemplateName":"TestTemplate"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "TemplateID": "TMP2CON2", "Text Content": "Text content of a template" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatetextcontentbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateName"":""TestTemplate""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatetextcontentbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateName":"TestTemplate"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get template categories
This endpoint will return all template categories created in your CM Email Marketing account.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/templates/templatecategorylistfetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
Body is not required for this call.
- Successful Response – 200 OK
-
{ "Total Record(s)": "1", "Results": [ { "ID": "ABCD1234", "Name": "Newsletter", "Description": "Monthly Newsletters" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatecategorylistfetch", Method.Get);
request.AddHeader("Authorization", {{token}});
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatecategorylistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Create a template category
This endpoint will allow you to create a template category in your CM Email Marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/templates/templatecategorycreate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{"TemplateCategoryName":"Newsletter"}
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "TemplateCategoryID": "ABCD12345", "TemplateCategoryName": "Newsletter", "TemplateCategoryDescription": "", "CreatedDate": "19/09/2023 11:55", "ModifiedDate": "19/09/2023 11:55" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatecategorycreate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateCategoryName"":""Newsletter""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatecategorycreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateCategoryName":"Newsletter"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a template category
This endpoint will allow you to delete a template category from your CM Email Marketing account.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/{{TemplateCategoryId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/ABCD1234
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template category deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatecategorydelete/ABCD1234", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatecategorydelete/ABCD1234');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Create a template (open editor only)
This endpoint will allow you to create a template in your CM Email Marketing account. A template created using this call will be editable only in open editor in CM Email Marketing account.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/templates/templatecreate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "TemplateName":"Template 1", "TemplateDescription":"API Template 1", "TemplateCategoryID":"ABCD1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "TemplateID": "ABCD12345", "TemplateName": "Template 1", "TemplateDescription": "API Template 1", "CreatedDate": "19/09/2023 13:29", "ModifiedDate": "19/09/2023 13:29" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatecreate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateName"":""Template 1"",""TemplateDescription"":""API Template 1"", ""TemplateCategoryID"":""ABCD1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatecreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateName":"Template 1","TemplateDescription":"API Template 1", "TemplateCategoryID":"ABCD1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update template information
This endpoint will allow you to update a template information in your CM Email Marketing account. You can update information like TemplateName, FromName, SubjectLine, FromAddress, PreheaderText and EnabledReplies in an existing template using this request. Template has to exist in your CM Email Marketing account in order to update the information. You can use Get Templates call to fetch existing templates from an account. This call will override the existing information with the new information provided. Please ensure that FromAddress contains a subdomain that is assigned to your account.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/templates/templateedit
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "TemplateID":"ABCD1234", "TemplateName":"API Template 2", "FromName":"Campaign Master UK Ltd", "SubjectLine":"Welcome to our newsletter", "FromAddress":"example@youraccountdomainhere...", "PreheaderText":"This information will be displayed as preheader", "EnableReplies":"0" } /* "EnableReplies":"1" -- This can be 0 or 1. If this is 1 then additional parameter in the body is required with your redirect email address as value. "RedirectEmailAddress":"abc@yourcompany.com" */
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templateedit", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateID"":""ABCD1234"",""TemplateName"":""API Template 2"",""FromName"":""Campaign Master UK Ltd"",""SubjectLine"":""Welcome to our newsletter"",""FromAddress"":""example@youraccountdomainhere..."",""PreheaderText"":""This information will be displayed as preheader"",""EnableReplies"":""0""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templateedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateID":"ABCD1234","TemplateName":"API Template 2","FromName":"Campaign Master UK Ltd","SubjectLine":"Welcome to our newsletter","FromAddress":"example@youraccountdomainhere.com","PreheaderText":"This information will be displayed as preheader","EnableReplies":"0"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add html content (open editor only)
This endpoint will allow you to add HTML content in a template created in your CM Email Marketing account using open editor. Template has to exist in your CM Email Marketing account in order to add content. You can use Get Templates call to fetch existing templates from an account. This call will replace your existing HTML with the new the new HTML provided in this call.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/templates/templateaddhtmlcontent
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "TemplateID":"ABCD1234", "HtmlContent":"This is my new Html Content and it will be replaced with the existing one." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template html updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templateaddhtmlcontent", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateID"":""TMP8CON168"",""HtmlContent"":""This is my new HtmlContent and it will be replaced with the existing one.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templateaddhtmlcontent');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateID":"TMP8CON168","HtmlContent":"This is my new HtmlContent and it will be replaced with the existing one."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add text content (open editor only)
This endpoint will allow you to add TEXT content in a template created in your CM Email Marketing account using open editor. Template has to exist in your CM Email Marketing account in order to add content. You can use Get Templates call to fetch existing templates from an account. This call will replace your existing TEXT with the new the new TEXT provided in this call.Supported method: PUT
Details
- Endpoint
- PUT
{{apiurl}}/api/{{api-version}}/templates/templateaddtextcontent
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "TemplateID":"ABCD1234", "TextContent":"This is my new TEXT Content and it will be replaced with the existing one." }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template text content updated successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templateaddtextcontent", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateID"":""ABCD1234"",""TextContent"":""This is my new Text Content and it will be replaced with the existing one.""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templateaddtextcontent');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateID":"ABCD1234","TextContent":"This is my new HtmlContent and it will be replaced with the existing one."}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Generates an editor link
Using this call an editor link will be generated for a TemplateId specified in the URL of this request. You can use this link to directly open an editor to modify template content.Supported method: GET
Details
- Endpoint
- GET
{{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/{{TemplateId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request
-
{{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/ABCD1234
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
https://editorlinkurlgenerated
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templateeditorlinkcreate/ABC12345", Method.Get);
request.AddHeader("Authorization", {{token}});
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templateeditorlinkcreate/ABC12345');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete a template
This endpoint will allow you to delete a template from your CM Email Marketing account.Supported method: DEL
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/templates/templatedelete/{{TemplateId}}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request URL
-
{{apiurl}}/api/{{api-version}}/templates/templatedelete/ABCD1234
This should be passed in the URL of a request as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatedelete/ABCD1234", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatedelete/ABCD1234');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Send email notifications using a template
This endpoint will allow you to sent a notfication to a specified email address using template created in your CM Email Marketing account. Ensure that you have tested a template and completed template information e.g. From Name, From Address, subject in your template before using this call.Supported method: POST
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/templates/sendnotificationemailthroughtemplate
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "EmailAddress":"dummyemail@example.com", "TemplateID":"ABCD1234" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Template scheduled successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/sendnotificationemailthroughtemplate", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"":""dummyemail@example.com"",""TemplateID"":""ABCD1234""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/sendnotificationemailthroughtemplate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress":"dummyemail@example.com","TemplateID":"ABCD1234"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Channels
This section outlines all API endpoints which allow you to manage channels and channel suppression within your CM Email Marketing account.- {{apiurl}}/api/{{api-version}}/module/channel/create
- {{apiurl}}/api/{{api-version}}/module/channel/updatebyid
- {{apiurl}}/api/{{api-version}}//module/channel/updatebyname
- {{apiurl}}/api/{{api-version}}/module/Channel/DeleteByID/{{ChannelID}}
- {{apiurl}}/api/{{api-version}}/module/Channel/DeleteByName
- {{apiurl}}/api/{{api-version}}/module/channel/fetch
- {{apiurl}}/api/{{api-version}}/module/channel/fetchbyid/{{ChannelID}}
- {{apiurl}}/api/{{api-version}}/module/channel/fetchbyname
- {{apiurl}}/api/{{api-version}}/module/Channel/Suppression/RecipientListFetch
- {{apiurl}}/api/{{api-version}}/module/channel/suppression/recipientsadd
- {{apiurl}}/api/{{api-version}}/module/channel/suppression/removebyemailaddress
Create Channel
This endpoint will allow to create a channel in your CM Email Marketing account using POST http method.Details
- Endpoint
- POST
{{api-url}}/api/{{api-version}}/module/channel/create
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "Name":"Channel A", "Description":"Channel A Description" }
Following should be passed in request body as JSON as shown below:
- Response – 200 OK
-
{ "ID": "9", "Name": "Channel A", "Description": "Channel A Description", "CreatedDate": "18/10/2024", "ModifiedDate": "18/10/2024", "Message": "Channel created successfully." }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/create", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel A"",""Description"":""Channel A Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/create');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel1","Description":"Channel1 Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update Channel by ID
This endpoint will allow to update channel information in your CM Email Marketing account using PUT http method. Channel ID is required for this call.Details
- Endpoint
- PUT
{{api-url}}/api/{{api-version}}/module/channel/updatebyid
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ID":"9", "Name":"Channel D" "Description":"Channel D Description" }
Following should be passed in request body as JSON as shown below:
- Response – 200 OK
-
{ "ID": "9", "Name": "Channel D", "Description": "Channel D Description", "CreatedDate": "18/10/2024", "ModifiedDate": "18/10/2024", "Message": "Channel updated successfully." }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/updatebyid", Method.Get);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ID"":""9"",""Name"":""Channel D"",""Description"":""Channel D Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/updatebyid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ID":"9","Name":"Channel D","Description":"Channel D Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Update Channel by Name
This endpoint will allow to update channel information in your CM Email Marketing account using PUT http method. Existing channel name is required for this call.Details
- Endpoint
- PUT
{{api-url}}/api/{{api-version}}/module/channel/updatebyname
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ExistingChannelName":"Channel D", "NewChannelName":"Channel A", "ChannelDescription":"Channel A Description" }
Following should be passed in request body as JSON as shown below:
- Response – 200 OK
-
{ "ID": "9", "Name": "Channel A", "Description": "Channel A Description", "CreatedDate": "18/10/2024", "ModifiedDate": "18/10/2024", "Message": "Channel updated successfully." }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/updatebyname", Method.Get);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ExistingChannelName"":""Channel D"",""NewChannelName"":""Channel A"",""ChannelDescription"":""Channel A Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/updatebyid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ExistingChannelName":"Channel D","NewChannelName":"Channel A","ChannelDescription":"Channel A Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete Channel By Id
This endpoint will allow you to delete channel by ID in your CM Email Marketing account using DEL http method. Channel ID is required for this call.Details
- Endpoint
- DEL
{{api-url}}/api/{{api-version}}/module/channel/deletebyid/{channelid}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Response – 200 OK
-
{ "Message": "Channel deleted successfully." }
Example Request
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/deletebyid/{channelid}", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/deletebyid/{channelid}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Delete Channel By Name
This endpoint will allow you to delete channel by Name in your CM Email Marketing account using DEL http method. Channel Name is required for this call.Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/module/Channel/DeleteByName
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "Name":"Channel A" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Channel deleted successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/Channel/DeleteByName", Method.Delete);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel A""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/Channel/DeleteByName');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel A"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Channels List
This endpoint will allow you to fetch channels list in your CM Email Marketing account using POST http method. PageNumber and PageSize is required for this call and Criteria is optional.Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/module/channel/fetch
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "PageNumber":"1", "PageSize":"2", "Criteria": {"FieldName":"ChannelName","Operator":"contains","FieldValue":"channel"} }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "ID": "5", "Name": "Channel B", "Descripion": "", "CreatedDate": "18/10/2024", "ModifiedDate": "18/10/2024" }, { "ID": "4", "Name": "Channel A1", "Descripion": "Channel A1 Description", "CreatedDate": "18/10/2024", "ModifiedDate": "18/10/2024" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetch", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{ ""PageNumber"":""1"",""PageSize"":""2"",
" + "\n" +
@"""Criteria"":
" + "\n" +
@"{""FieldName"":""ChannelName"",""Operator"":""contains"",""FieldValue"":""channel""}}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetch');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{ "PageNumber":"1","PageSize":"2",
\n"Criteria":
\n{"FieldName":"ChannelName","Operator":"contains","FieldValue":"channel"}}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Channel by ID
This endpoint will allow you to get channel information by ID in your CM Email Marketing account using GET http method. Channel ID is required for this call.Details
- Endpoint
- Get
{{apiurl}}/api/{{api-version}}/module/channel/fetchbyid/{channelid}
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
Body is not required for this call.
- Successful Response – 200 OK
-
{ "ID": "1", "Name": "Newsletters", "Descripion": "Newsletters", "CreatedDate": "25/04/2024", "ModifiedDate": "25/04/2024" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetchbyid/{channelid}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetchbyid/{channelid}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Channel by Name
This endpoint will allow you to get channel information by ID in your CM Email Marketing account using POST http method. Channel Name is required for this call.Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/module/channel/fetchbyname
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "Name":"Channel D" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "ID": "9", "Name": "Channel D", "Description": "Channel D Description", "CreatedDate": "21/10/2024", "ModifiedDate": "21/10/2024" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetchbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel D""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetchbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel D"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Get Channel Suppressed Recipients List
This endpoint will allow you to fetch list of recipients that are suppressed in the specified channels in your CM Email Marketing account using POST http method.Parameters
PageNumber (Required)
PageSize (Required)
ChannelName (Optional) – If channel name is passed in the call then it will search recipient against this channel only.
Criteria (Optional) – In criteria the below parameters need to pass
FieldName : (SuppressedAddress / SuppressedBy / SuppressedDate / SuppressedVia)
Operator: (contains / doesnotcontain / startswith / endswith / equals / notequalto)
FieldValue: this is the value you want to search
If you are searching by field name SuppressedVia than operator parameter will be optional to pass in the call. The valid value for field value parameter in this case are (all / import / manual / unsubscribe link)
Details
- Endpoint
- POST
{{apiurl}}/api/{{api-version}}/module/channel/suppression/recipientlistfetch
- Request Headers
-
{ "PageNumber":"1", "PageSize":"2", "Criteria": {"FieldName":"SuppressedVia","FieldValue":"manual"} }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Total Record(s)": "2", "Results": [ { "SuppressedAddress": "Recipient1@demo.com", "SuppressedChannel": "Newsletters", "SuppressesVia": "Manual", "SuppressedBy": "John Doe", "DateSuppressed": "18/10/2024" }, { "SuppressedAddress": "Recipient2@demo.com", "SuppressedChannel": "Newsletters", "SuppressesVia": "Manual", "SuppressedBy": "John Smith", "DateSuppressed": "20/09/2024" } ] }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/recipientlistfetch", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", {{token}});
var body = @"{""PageNumber"":""1"",""PageSize"":""2"",""ChannelName"":""Newsletters1"",""Criteria"":{""FieldName"":""SuppressedVia"",""FieldValue"":""manual""}}";
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/recipientlistfetch');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"PageNumber":"1","PageSize":"2","ChannelName":"Newsletters1","Criteria":{"FieldName":"SuppressedVia","FieldValue":"manual"}}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Add Recipient to Channel Suppression
This endpoint will allow you to add a recipient to channel suppression in your CM Email Marketing account using POST http method. Channel name and email address are required in this call.If you want to add email address in multiple channel suppression then you can provide comma separated values for Channel name parameter.
Details
- Endpoint
- Post
{{apiurl}}/api/{{api-version}}/module/channel/suppression/recipientsadd
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ChannelName":"Newsletters", "EmailAddress":"demo@campaignmaster.co.uk" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient(s) added to the channel suppression successfully." }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/recipientsadd", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{ ""ChannelName"":""Newsletters"",""EmailAddress"":""demo@campaignmaster.co.uk""} ";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/recipientsadd');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{ "ChannelName":"Channel B11","EmailAddress":"demo@campaignmaster.co.uk"} ');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Remove Recipient from Channel Suppression
This endpoint will allow you to remove recipient from channel suppression in your CM Email Marketing account using DEL http method.If you want to remove email address from multiple channel suppression then you can provide comma separated values for Channel name parameter.
Details
- Endpoint
- DEL
{{apiurl}}/api/{{api-version}}/module/channel/suppression/removebyemailaddress
- Request Headers
-
Content-Type : application/json // Authorization: Bearer {{token}} string token
- Request Body
-
{ "ChannelName":"Newsletters","EmailAddress":"demo@campaignmaster.co.uk" }
Following should be passed in request body as JSON as shown below:
- Successful Response – 200 OK
-
{ "Message": "Recipient removed from newsletters channel suppression successfully" }
Example Request
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/removebyemailaddress", Method.Delete);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ChannelName"":""Newsletters"",""EmailAddress"":""gunjan.gupta@campaignmaster.co.uk""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/removebyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ChannelName":"Newsletters","EmailAddress":"demo@campaignmaster.co.uk"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}