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.
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. |
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 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. |
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./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.{{api-url}}/api/{{api-version}}/authenticate
username: {{username}}
password: {{password}}
{
"token": "{{token}}"
}
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();
}
{{api-url}}/api/{{api-version}}/domainlistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Total Record(s)": "2",
"Results": [
{
"DomainName": "abc.example.com"
},
{
"DomainName": "xyz.example.com"
}
]
}
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();
}
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignwiplistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}
]
}
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();
}
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchbyid/{{CampaignID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}
}
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();
}
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchhtmlcontent/{{CampaignID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": {
"CampaignID": "CMP123456789",
"HtmlContent": "HTML Content",
}
}
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();
}
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignfetchtextcontent/{{CampaignID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": {
"CampaignID": "CMP123456789",
"HtmlContent": "TEXT Content",
}
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigncreate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignName":"API Campaign 1",
"campaignDescription":"API Campaign Description",
"templateid":"TMP1234566"
}
{
"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."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignedit
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}
{
"CampaignID": "CMP123456789",
"CampaignName": "API Campaign 1",
"CreatedDate": "13/10/2023 13:23",
"ModifiedDate": "13/10/2023 13:23",
"Message": "Campaign updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddhtmlcontent
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"HtmlContent":"Html Content added through API."
}
{
"Message": "Campaign html updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignaddtextcontent
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"HtmlContent":"Text Content added through API."
}
{
"Message": "Campaign text updated successfully."
}
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();
}
GET
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate/{{CampaignID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaigneditorlinkcreate/ABCD1234
https://editorlinkurlgenerated
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();
}
PUT
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignattachlist
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"ListID":"ABC1234"
}
{
"Message": "List attached successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignsendtestemail
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"PersonalisationEmailAddress":"example@example.com",
"TestEmailAddresses":"example@example.com"
}
{
"Message": "Test emails sent successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignlaunchimmediately
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789"
}
{
"Message": "Campaign launched successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignschedule
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"ScheduleDateTime":"2023-11-03 14:20" //Date format should be (yyyy-mm-dd hh:mm)
}
{
"Message": "Campaign launched successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/resendtorcptfromregularsentcampaign
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"EmailAddress":"example@dummyemail.com",
"ListID":"ABC1234"
}
{
"Message": "Resend campaign job created successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/resendtolistfromregularsentcampaign
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"ListID":"ABC1234"
}
{
"Message": "Resend campaign job created successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaigns/resendusingcriteriafromregularsentcampaign
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID":"CMP123456789",
"Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"dummy","LogicalOperator":"and","LeftParentheses":false,"RightParentheses":false}]
}
{
"Message": "Resend campaign job created successfully."
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/campaigns/resendusingcriteriafromregularsentcampaign", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP123456789"",""Criteria"":[{""FieldName"":""Email Address"",""Operator"":""contains"",""FieldValue"":""qamar"",""LogicalOperator"":""and"",""LeftParentheses"":false,""RightParentheses"":false}]}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/campaigns/resendusingcriteriafromregularsentcampaign');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP123456789","Criteria":[{"FieldName":"Email Address","Operator":"contains","FieldValue":"dummy","LogicalOperator":"and","LeftParentheses":false,"RightParentheses":false}]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/database/databasefieldsfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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": ""
}
]
}
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
{{apiurl}}/api/{{api-version}}/database/globalsuppressionlistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}
]
}
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();
}
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 |
POST
{{apiurl}}/api/{{api-version}}/database/databasefieldadd
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
//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"}]}
{
"FieldID": "FG2T4I45E",
"FieldName": "SelectionBox Field1",
"FieldDescription": "Some Field Description",
"FieldType": "SELECTIONBOX",
"MaxLength": "50",
"DefaultValue": null
}
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();
}
GET
{{apiurl}}/api/{{api-version}}/lists/listfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
},
]
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/lists/listcreate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ListName":"Marketing List",
"ListDescription":"Created through API."
}
{
"ID": "ABCD1234",
"ListName": "Marketing List",
"ListDescription": "Created through API.",
"TotalCount": "0",
"CreatedDate": "19/09/2023 03:52",
"ModifiedDate": "19/09/2023 03:52"
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/lists/listedit
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ListID": "ABCD1234",
"ListName":"Marketing List",
"ListDescription":"Created through API."
}
{
"Message": "List updated successfully."
}
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();
}
DEL
{{apiurl}}/api/{{api-version}}/lists/listdelete/{{ListId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/lists/listdelete/ABCD1234
{
"Message": "List deleted successfully."
}
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();
}
DEL
{{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/{{ListId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/lists/listdeletewithrecipients/ABCD1234
{
"Message": "List deleted successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/lists/listempty
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ListID": "ABCD1234"
}
{
"Message": "Recipient(s) deleted from the list successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/getrecipients
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"PageNumber":1,"PageSize":100,
"Criteria":[{
"FieldName":"Email Address",
"Operator":"contains",
"FieldValue":"example",
"LogicalOperator":"or",
"LeftParentheses":false,
"RightParentheses":false
}]
}
{
"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"
}
]
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"EmailAddress" :"example@dummyemail.com"}
{
"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"
}]
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/recipientinformationfetchbyrecipientid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"RecipientID" :"ABC1234"}
{
"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"
}]
}
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
{{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/{{ListId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/getrecipientsbylistid/ABCD1234
{
"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"
}
}
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
{{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid/{{RecipientId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/recipientlistsbyrecipientid/ABC123
{
"Results": {
"EmailAddress": "example@dummyemail.com",
"ExternalID": "ABC123",
"RecipientLists": [
{
"ListID": "ABCD1234",
"ListName": "API LIST 1"
},
{
"ListID": "ABCD4567",
"ListName": "API LIST 2"
}
]
}
}
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
{{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory/{{RecipientId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/recipientcampaignshistory/ABC123
{
"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": ""
}]
}
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/addrecipient
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"EmailAddress": "example@dummyemail.com",
"ListID": ["ABC123","ABC456"]
}
{
"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."
},
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/addorupdaterecipient
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
//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"
}
]
}
{
"RecipientID": "ABC1234",
"EmailAddress": "example@dummyemail.com",
"StatusMessage": "Recipient added successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/addrecipientstolists
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
//Adding a single or multiple recipient(s) to a single or multiple list(s).
{
"Recipients": [
{
"RecipientID": "ABC1234"
},
{
"RecipientID": "ABC5678"
}
],
"Lists": [
{
"ListID": "ABC123"
},
{
"ListID": "ABC456"
}
]
}
{
"Message": "Recipient added to list(s) successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}]
}
{
"RecipientID": "ABC123",
"EmailAddress": "example@dummyemail.com",
"CreatedDate": "18/09/2023",
"ModifiedDate": "18/09/2023",
"Message": "Recipient updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientupdatebyrecipientid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}]
}
{
"RecipientID": "ABC123",
"EmailAddress": "example@dummyemail.com",
"CreatedDate": "18/09/2023",
"ModifiedDate": "18/09/2023",
"Message": "Recipient updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"ExistingEmailAddress":"example@dummyemail.com","NewEmailAddress":"example123@dummyemail.com"}
{
"Message": "Recipient updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/recipients/recipientemailaddresseditbyrecipientid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"EmailAddress":"example4@dummyemail.com","RecipientID":"ABCD1234"}
{
"Message": "Recipient updated successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletebyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"EmailAddress" :"example@dummyemail.com"}
{
"Message": "Recipient deleted successfully."
}
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();
}
DEL
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/recipientdeletefromdatabase/{{RecipientId}}
{
"Message": "Recipient deleted successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/removerecipientfromlist
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"RecipientID": "ABCD1234","ListID":"ABC123"}
{
"Message": "Recipient deleted from the list successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/recipients/removerecipientsfromlists
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"ListID":["ABC123","XYZ123"],"RecipientID":["ABCD1234","XYZ1234"]}
{
"Message": "Recipient(s) deleted from the list(s) successfully."
}
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();
}
GET
{{apiurl}}/api/{{api-version}}/templates/templatelistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
}
]
}
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
{{apiurl}}/api/{{api-version}}/templates/templatefetchhtmlcontent/{{TemplateId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/templatefetchhtmlcontent/ABCD1234
{
"TemplateID": "ABC12345",
"HTML Content": "HTML Content of a template."
}
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
{{apiurl}}/api/{{api-version}}/templates/templatefetchtextcontent/{{TemplateId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/recipients/templatefetchtextcontent/ABCD1234
{
"TemplateID": "ABC12345",
"HTML Content": "HTML Content of a template."
}
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
{{apiurl}}/api/{{api-version}}/templates/templatecategorylistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Total Record(s)": "1",
"Results": [
{
"ID": "ABCD1234",
"Name": "Newsletter",
"Description": "Monthly Newsletters"
}
]
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/templates/templatecategorycreate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"TemplateCategoryName":"Newsletter"}
{
"TemplateCategoryID": "ABCD12345",
"TemplateCategoryName": "Newsletter",
"TemplateCategoryDescription": "",
"CreatedDate": "19/09/2023 11:55",
"ModifiedDate": "19/09/2023 11:55"
}
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();
}
DEL
{{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/{{TemplateCategoryId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/templates/templatecategorydelete/ABCD1234
{
"Message": "Template category deleted successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/templates/templatecreate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"TemplateName":"Template 1",
"TemplateDescription":"API Template 1",
"TemplateCategoryID":"ABCD1234"
}
{
"TemplateID": "ABCD12345",
"TemplateName": "Template 1",
"TemplateDescription": "API Template 1",
"CreatedDate": "19/09/2023 13:29",
"ModifiedDate": "19/09/2023 13:29"
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/templates/templateedit
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"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"
*/
{
"Message": "Template updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/templates/templateaddhtmlcontent
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"TemplateID":"ABCD1234",
"HtmlContent":"This is my new Html Content and it will be replaced with the existing one."
}
{
"Message": "Template html updated successfully."
}
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();
}
PUT
{{apiurl}}/api/{{api-version}}/templates/templateaddtextcontent
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"TemplateID":"ABCD1234",
"TextContent":"This is my new TEXT Content and it will be replaced with the existing one."
}
{
"Message": "Template text content updated successfully."
}
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();
}
GET
{{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/{{TemplateId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/templates/templateeditorlinkcreate/ABCD1234
https://editorlinkurlgenerated
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();
}
DEL
{{apiurl}}/api/{{api-version}}/templates/templatedelete/{{TemplateId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/templates/templatedelete/ABCD1234
{
"Message": "Template deleted successfully."
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/templates/sendnotificationemailthroughtemplate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"EmailAddress":"dummyemail@example.com",
"TemplateID":"ABCD1234"
}
{
"Message": "Template scheduled successfully."
}
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();
}