CM Email Marketing API

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.

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();
                                                }
                                    

Campaigns

This section outlines all API endpoints which allow you to manage campaigns within your CM Email Marketing account.

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",
                                        "HtmlContent": "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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignName":"API Campaign 1",
                                    "campaignDescription":"API Campaign Description",
                                    "templateid":"TMP1234566"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "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"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "HtmlContent":"Html Content added through API."
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "HtmlContent":"Text Content added through API."
                                }
									
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
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
                                    
                                                {{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate/ABCD1234
                                                
                                                            
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "ListID":"ABC1234"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "PersonalisationEmailAddress":"example@example.com",
                                    "TestEmailAddresses":"example@example.com"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "ScheduleDateTime":"2023-11-03 14:20" //Date format should be (yyyy-mm-dd hh:mm) 
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "EmailAddress":"example@dummyemail.com",
                                    "ListID":"ABC1234"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "ListID":"ABC1234"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "CampaignID":"CMP123456789",
                                    "Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"dummy","LogicalOperator":"and","LeftParentheses":false,"RightParentheses":false}]
                                }
									
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();
                                    }
                                                        

Database

This section outlines all API endpoints which allow you to manage custom fields and global suppression within your CM Email Marketing account:

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();
												  }
										

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
This should be passed in JSON format as shown below:
                                    
                                //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"}]}
                            
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();
												  }
										

Lists

This section outlines all API endpoints which allow you to manage Lists within your CM Email Marketing account:

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
Following should be passed in request body as JSON as shown below:
                                    
							{
							"ListName":"Marketing List",
							"ListDescription":"Created through API."
							}
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "ListID": "ABCD1234",
                                    "ListName":"Marketing List",
                                    "ListDescription":"Created through API."
                                }
									
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
This should be passed in the URL of a request as shown below:
                                    
								{{apiurl}}/api/{{api-version}}/lists/listdelete/ABCD1234
									
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
This should be passed in the URL of a request as shown below:
                                    
								{{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/ABCD1234
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "ListID": "ABCD1234"
                                }
									
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:

Get recipients

Get recipients CM Email Marketing account using an 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
This should be passed in JSON format as shown below:
                                    
                {
                "PageNumber":1,"PageSize":100,
                "Criteria":[{
                "FieldName":"Email Address",
                "Operator":"contains",
                "FieldValue":"example",
                "LogicalOperator":"or",
                "LeftParentheses":false,
                "RightParentheses":false
                }]
                }
                                                    
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.
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
This should be passed in JSON format as shown below:
                                    
                                {"EmailAddress" :"example@dummyemail.com"}
                                                    
Successful Response – 200 OK
                                    
                                {
                                    "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"
                                        }]
                                    }
                                                    

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.
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
This should be passed in JSON format as shown below:
                                    
                                {"RecipientID" :"ABC1234"}
                                                    
Successful Response – 200 OK
                                    
                                {
                                    "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"
                                        }]
                                    }
                                                    

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
This should be passed in the URL of a request as shown below:
                                    
                {{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/ABCD1234
                                
                                            
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
This should be passed in the URL of a request as shown below:
                                    
                {{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid/ABC123
                                
                                            
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
This should be passed in the URL of a request as shown below:
                                    
                {{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory/ABC123
                                
                                            
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
This should be passed in JSON format as shown below:
                                    
								{
									"EmailAddress": "example@dummyemail.com",
									"ListID": ["ABC123","ABC456"]
								}
									
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
This should be passed in JSON format as shown below:
                                    
								//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"
										}
									]
								}
									
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
This should be passed in JSON format as shown below:
                                    
								//Adding a single or multiple recipient(s) to a single or multiple list(s).
								{
									"Recipients": [
										{
											"RecipientID": "ABC1234"
										},
										{
											"RecipientID": "ABC5678"
										}
									],
									"Lists": [
										{
											"ListID": "ABC123"
										},
										{
											"ListID": "ABC456"
										}
									]
								}
									
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
This should be passed in the body of a request in JSON format as shown below:
                                    
                            {
                    "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"
                        }]
                    }
                                
                                            
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
This should be passed in the body of a request in JSON format as shown below:
                                    
                            {
                                "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"
                                }]
                            }
                                
                                            
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
This should be passed in the body of a request in JSON format as shown below:
                                
                                    {"ExistingEmailAddress":"example@dummyemail.com","NewEmailAddress":"example123@dummyemail.com"}
                                
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
This should be passed in the body of a request in JSON format as shown below:
                                
                                    {"EmailAddress":"example4@dummyemail.com","RecipientID":"ABCD1234"}
                                
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
This should be passed in JSON format as shown below:
                                    
                                {"EmailAddress" :"example@dummyemail.com"}
                                                    
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
This should be passed in the URL of a request as shown below:
                                    
								{{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
									
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
This should be passed in JSON format as shown below:
                                    
                                {"RecipientID": "ABCD1234","ListID":"ABC123"}
                                                    
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
This should be passed in JSON format as shown below:
                                    
                                {"ListID":["ABC123","XYZ123"],"RecipientID":["ABCD1234","XYZ1234"]}
                                                    
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();
                }
                                                        

Templates

This section outlines all API endpoints which allow you to manage templates within your CM Email Marketing account.

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.
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
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
                                    
                                                {{apiurl}}/api/{{api-version}}/recipients/templatefetchhtmlcontent/ABCD1234
                                                
                                                            
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 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
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
                                    
                                                {{apiurl}}/api/{{api-version}}/recipients/templatefetchtextcontent/ABCD1234
                                                
                                                            
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/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 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
Following should be passed in request body as JSON as shown below:
                                    
								{"TemplateCategoryName":"Newsletter"}
									
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
This should be passed in the URL of a request as shown below:
                                    
								{{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/ABCD1234
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "TemplateName":"Template 1",
                                    "TemplateDescription":"API Template 1",
                                    "TemplateCategoryID":"ABCD1234"
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "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"
                                */
                                
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "TemplateID":"ABCD1234",
                                    "HtmlContent":"This is my new Html Content and it will be replaced with the existing one."
                                    
                                }
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "TemplateID":"ABCD1234",
                                    "TextContent":"This is my new TEXT Content and it will be replaced with the existing one."
                                    
                                }
									
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
Body is not required for this call.TemplateId should be passed in the URL of a request as shown below:
                                    
                                                {{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/ABCD1234
                                                
                                                            
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
This should be passed in the URL of a request as shown below:
                                    
								{{apiurl}}/api/{{api-version}}/templates/templatedelete/ABCD1234
									
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
Following should be passed in request body as JSON as shown below:
                                    
                                {
                                    "EmailAddress":"dummyemail@example.com",
                                    "TemplateID":"ABCD1234"
                                }
									
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();
                                    }