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();
}
Get
{{api-url}}/api/{{api-version}}/automation/getautomationcampaigns
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": [
{
"CampaignID": "CMP122CON124",
"CampaignName": "Atmn Camp 1",
"CampaignDescription": "Atmn Camp 1",
"CampaignStatus": "Approved",
"CreatedDate": "23/08/2022 11:59",
"ModifiedDate": "23/08/2022 11:59"
},
{
"CampaignID": "CMP130CON132",
"CampaignName": "Atmn Camp 5",
"CampaignDescription": "Atmn Camp 5",
"CampaignStatus": "Draft",
"CreatedDate": "31/08/2022 16:05",
"ModifiedDate": "31/08/2022 16:05"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/automation/getautomationcampaigns")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/automation/getautomationcampaigns');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Post
{{api-url}}/api/{{api-version}}/automation/getautomationcampaignresults
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": [
{
"RuleID": "1",
"RuleName": "Client Flow 1",
"CampaignID": "CMP125CON127",
"CampaignName": "Atmn Camp 4",
"RecipientID": "79",
"RecipientEmail": "recipient1@example.com",
"SentDate": "25/08/2022 14:22"
},
{
"RuleID": "1",
"RuleName": "Client Flow 1",
"CampaignID": "CMP125CON127",
"CampaignName": "Atmn Camp 4",
"RecipientID": "79",
"RecipientEmail": "recipient1@example.com",
"SentDate": "23/08/2022 12:40"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/automation/getautomationcampaignresults")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/automation/getautomationcampaignresults');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{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",
"TextContent": "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",
"TextContent":"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();
}
DEL
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwipdelete/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaigns/regularcampaignwipdelete/{{CampaignId}}
{
"Message": "Campaign deleted successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaigns/regularcampaignwipdelete/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaigns/regularcampaignwipdelete/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignimagedownloads/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignimagedownloads/{{CampaignId}}
[
{
"EmailAddress": "recipient1@example.com",
"LastImageDownloadDate": "12/04/2022 14:26"
},
{
"EmailAddress": "recipient2@example.com",
"LastImageDownloadDate": "12/04/2022 12:36"
}
]
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/CampaignImageDownloads/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/CampaignImageDownloads/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}
{
"OpensAll": "10",
"OpensUnique": "3",
"LinksClickedAll": "9",
"LinksClickedUnique": "2",
"ImageDownloadsAll": "10",
"ImageDownloadsUnique": "3",
"Complaints": "0",
"GlobalUnsubscribes": "0",
"ForwardToAFriendFormSubmissionsAll": "0",
"ForwardToAFriendFormSubmissionsUnique": "0",
"NoRecordActivity": "9"
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignrecipientactivityfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresults/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresults/{{CampaignId}}
{
"CampaignID": "CMP1CON1",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CampaignType": "Regular",
"EditorType": "Hybrid Editor",
"CampaignStatus": "Sent",
"CreatedDate": "11/04/2022 12:41",
"CreatedBy": "Recipient1",
"ScheduledLaunchTime": "11/04/2022 12:57:00",
"LaunchedBy": "super super",
"TotalRecipients": "19",
"TotalSuccessfulSends": "15",
"TotalReceipts": "12",
"TotalBounces": "1",
"HardBounces": "1",
"SoftBounces": "0",
"OpensAll": "10",
"OpensUnique": "3",
"OpensReceiptsPercentage": "20%",
"LinksClickedAll": "9",
"LinksClickedUnique": "2",
"LinksClickedReceiptsPercentage": "13.33%",
"UniqueClicksToOpenRateReceiptsPercentage": "66.67%",
"ImageDownloadsAll": "10",
"ImageDownloadsUnique": "3",
"ImageDownloadsReceiptsPercentage": "20%",
"Complaints": "0",
"ComplaintsReceiptsPercentage": "0%",
"GlobalUnsubscribes": "0",
"GlobalUnsubscribesReceiptsPercentage": "0%",
"ForwardToAFriendFormSubmissions": "0",
"ForwardToAFriendFormSubmissionsReceiptsPercentage": "0%",
"NoRecordActivity": "9",
"NoRecordActivityReceiptsPercentage": "47.37%"
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresults/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresults/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP131CON252","EmailAddress":"recipient1@example.com"}
{
"Results": {
"RecipientID": "RCP2I6O1060",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CampaignRecievedDate": "11/04/2022 12:57",
"Opens": "2",
"Clicks": "1",
"Forwards": "0",
"Bounced": "No",
"Unsubscribed": "No",
"BounceType": null,
"FirstTimeOpened": "12/04/2022 14:26:18",
"LastTimeOpened": "12/04/2022 14:26:18",
"FirstTimeClicked": "12/04/2022 14:27:06",
"LastTimeClicked": "12/04/2022 14:27:06"
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyemailaddress")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""EmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","EmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbypages
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP1CON1","Pagenumber":"1","pagesize":"2"}
{
"Results": [
{
"RecipientID": "RCP1I80O1",
"EmailAddress": "recipient1@example.com",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CampaignRecievedDate": "11/05/2023 14:44",
"Opens": "0",
"Clicks": "0",
"Forwards": "0",
"Bounced": "Yes",
"Unsubscribed": "No",
"BounceType": "Hard",
"FirstTimeOpened": "",
"LastTimeOpened": "",
"FirstTimeClicked": "",
"LastTimeClicked": ""
},
{
"RecipientID": "RCP1I81O1",
"EmailAddress": "recipient2@example.com",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CampaignRecievedDate": "11/05/2023 14:44",
"Opens": "0",
"Clicks": "0",
"Forwards": "0",
"Bounced": "Yes",
"Unsubscribed": "No",
"BounceType": "Hard",
"FirstTimeOpened": "",
"LastTimeOpened": "",
"FirstTimeClicked": "",
"LastTimeClicked": ""
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbypages")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""Pagenumber"":""1"",""pagesize"":""2""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbypages');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","Pagenumber":"1","pagesize":"2"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/campaignresultsbyrecipientid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP253CON1293","RecipientID":"RCP1I168O1"}
{
"Results": {
"RecipientID": "RCP1I7O1275",
"EmailAddress": "test1@test.com",
"CampaignName": "A-08",
"CampaignDescription": "A-08",
"CampaignRecievedDate": "01/02/2024 14:33",
"Opens": "0",
"Clicks": "0",
"Forwards": "0",
"Bounced": "Yes",
"Unsubscribed": "No",
"BounceType": "Hard",
"FirstTimeOpened": "",
"LastTimeOpened": "",
"FirstTimeClicked": "",
"LastTimeClicked": ""
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyrecipientid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP131CON252"",""RecipientID"":""RCP4I130217O9""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignresultsbyrecipientid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP131CON252","RecipientID":"RCP4I130217O9"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}
{
"Results": {
"StartDate": "21/07/2023 10:39",
"EndDate": "21/07/2023 11:18",
"TotalRecipients": "12",
"TotalActive": "7",
"TotalInActive": "5",
"TotalUnVerified": "2",
"TotalDomainSuppressed": "2",
"TotalGlobalSuppressed": "2",
"TotalSystemDomainSuppressed": "0",
"TotalSystemGlobalSuppressed": "0",
"TotalChannelSuppressed": "0"
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignsummaryrecipientcriteriafetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}
{
"Results": {
"CampaignID": "CMP1CON1",
"TotalMailSent": "15",
"MultiPartSendCount": "13",
"HtmlSendCount": "2",
"TextSendCount": "0",
"TotalBounce": "3",
"HardBounceCount": "3",
"SoftBounceCount": "0"
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignsummarysenddetailsfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignuniqueopens/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignuniqueopens/{{CampaignId}}
[
{
"EmailAddress": "recipient1@example.com",
"Opens": "2",
"FirstTimeOpenedDate": "21/07/2023 10:41",
"LastTimeOpenedDate": "21/07/2023 10:41"
}
]
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignuniqueopens/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignuniqueopens/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/campaignunsubscribes/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/campaignunsubscribes/{{CampaignId}}
{
"Total Record(s)": "1",
"Results": [
{
"EmailAddress": "recipient1@example.com",
"UnsubscribeDate": "05/02/2024 16:49"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/campaignunsubscribes/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/campaignunsubscribes/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}
{
"Total Record(s)": "2",
"Results": [
{
"RecipientExternalID": "RCP1I7O1275",
"EmailAddress": "test1@test.com",
"BounceDate": "01/02/2024 14:33"
},
{
"RecipientExternalID": "RCP1I6O1275",
"EmailAddress": "test2@test.com",
"BounceDate": "01/02/2024 14:33"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbycampaignid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/emailbouncefetchbydaterange
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"StartDate":"2022-07-01","EndDate":"2022-08-01"}
{
"Results": [
{
"RecipientExternalID": "RCP4I9O1060",
"EmailAddress": "recipient1@example.com",
"BounceDate": "02/07/2022 03:40"
},
{
"RecipientExternalID": "RCP4I9O1060",
"EmailAddress": "recipient2@example.com",
"BounceDate": "31/07/2022 03:40"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbydaterange")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""StartDate"":""2024-01-14"",""EndDate"":""2024-01-16""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/emailbouncefetchbydaterange');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"StartDate":"2024-01-14","EndDate":"2024-01-16"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{api-url}}/api/{{api-version}}/campaigns/regularcampaigninformationfetchbyid
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();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignactivityfetchbydate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"FromDate": "2022-04-01","ToDate":"2022-04-22"}
{
"Total Record(s)": "2",
"Results": [
{
"CampaignID": "CMP1CON1",
"CampaignName": "Campaign 1",
"CampaignDescription": "CMP1CON1",
"OpensUnique": "2",
"OpensTotal": "8",
"ClicksUnique": "2",
"ClicksTotal": "9",
"ImageDownloadsUnique": "2",
"ImageDownloadsTotal": "8",
"ForwardsUnique": "0",
"ForwardsTotal": "0",
"BouncesTotal": "0",
"UnsubscribesTotal": "0",
"ComplaintsTotal": "0",
"NoRecordActivityTotal": "1",
"SentDate": "11/04/2022 12:57"
},
{
"CampaignID": "CMP4CON6",
"CampaignName": "Campaign 2",
"CampaignDescription": "CMP4CON6",
"OpensUnique": "2",
"OpensTotal": "4",
"ClicksUnique": "1",
"ClicksTotal": "2",
"ImageDownloadsUnique": "2",
"ImageDownloadsTotal": "4",
"ForwardsUnique": "0",
"ForwardsTotal": "0",
"BouncesTotal": "0",
"UnsubscribesTotal": "0",
"ComplaintsTotal": "0",
"NoRecordActivityTotal": "1",
"SentDate": "13/04/2022 09:18"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignactivityfetchbydate/")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromDate"": ""2024-01-01"",""ToDate"":""2024-01-17""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignactivityfetchbydate/');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromDate": "2024-01-01","ToDate":"2024-01-17"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/campaigns/regularcampaignscheduledlistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Total Record(s)": "5",
"Results": [
{
"CampaignID": "CMP143CON1161",
"CampaignName": "Testing Account 1027",
"CampaignDescription": "Bounce rule Testing Account 1028",
"SentDate": "21/04/2023 15:34"
},
{
"CampaignID": "CMP148CON1166",
"CampaignName": "Testing Account 1028",
"CampaignDescription": "Bounce rule 4 Testing Account 1028",
"SentDate": "21/04/2023 16:00"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaigns/regularcampaignscheduledlistfetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaigns/regularcampaignscheduledlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/campaignresults/regularcampaignsentlistfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": [
{
"CampaignID": "CMP1CON1",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CreatedDate": "11/04/2022 12:41",
"ModifiedDate": "11/04/2022 12:57"
},
{
"CampaignID": "CMP157CON1182",
"CampaignName": "Campaign 2",
"CampaignDescription": "Campaign 2",
"CreatedDate": "04/05/2023 12:17",
"ModifiedDate": "04/05/2023 12:17"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignsentlistfetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignsentlistfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/regularcampaignssentbydate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"FromDate": "2022-04-01","ToDate":"2022-04-22"}
{
"Total Record(s)": "6",
"Results": [
{
"CampaignID": "CMP1CON1",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"SentDate": "11/04/2022 12:57"
},
{
"CampaignID": "CMP4CON6",
"CampaignName": "Campaign 2",
"CampaignDescription": "Campaign 2",
"SentDate": "13/04/2022 09:18"
},
{
"CampaignID": "CMP10CON12",
"CampaignName": "Campaign 6",
"CampaignDescription": "Campaign 6",
"SentDate": "13/04/2022 17:22"
},
{
"CampaignID": "CMP35CON37",
"CampaignName": " Campaign 9",
"CampaignDescription": "Campaign 9",
"SentDate": "21/04/2022 17:18"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/regularcampaignssentbydate/")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromDate"": ""2024-01-01"",""ToDate"":""2024-01-17""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/regularcampaignssentbydate/');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromDate": "2024-01-01","ToDate":"2024-01-17"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}
{
"CampaignID": "CMP1CON1",
"CampaignName": "Campaign 1",
"CampaignDescription": "Campaign 1",
"CampaignStatus": "Sent",
"CampaignType": "Regular",
"TrackedLinkResults": [
{
"TrackedLinkID": "TRK1ENT1",
"TrackedLinkName": "Tracked Sub",
"ClicksAll": "3",
"ClicksUnique": "1"
},
{
"TrackedLinkID": "TRK2ENT1",
"TrackedLinkName": "Tracked DC",
"ClicksAll": "5",
"ClicksUnique": "1"
},
{
"TrackedLinkID": "TRK3ENT1",
"TrackedLinkName": "Tracked Maintain My Details",
"ClicksAll": "1",
"ClicksUnique": "1"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbycampaignid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/campaignresults/trackedlinksresultbytrackedlinkid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP163CON1189","TrackedLinkID":"TRK1238ENT163","Pagenumber":"1","PageSize":"1"}
{
"CampaignID": "CMP9CON11",
"CampaignName": "A-08",
"CampaignDescription": "A-08",
"CampaignStatus": "Sent",
"CampaignType": "Regular",
"TrackedLinkID": "TRK2ENT9",
"TrackedLinkName": "Add to Safe Senders Link",
"TotalClicks": "1",
"UniqueClicks": "1",
"RecipientResults": [
{
"RecipientID": "RCP1I1O1275",
"EmailAddress": "test1@test.com",
"TotalClicks": "1",
"FirstTimeClicked": "01/02/2024 14:57",
"LastTimeClicked": "01/02/2024 14:57"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbytrackedlinkid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP139CON260"",""TrackedLinkID"":""TRK567ENT139"",""Pagenumber"":""1"",""PageSize"":""10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/campaignresults/trackedlinksresultbytrackedlinkid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP139CON260","TrackedLinkID":"TRK567ENT139","Pagenumber":"1","PageSize":"10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
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();
}
DEL
{{apiurl}}/api/{{api-version}}/database/databasefielddelete/{{DatabasefieldId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/database/databasefielddelete/{{DatabasefieldId}}
{
"Message": "Custom field deleted successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/database/databasefielddelete/{{DatabasefieldId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/database/databasefielddelete/{{DatabasefieldId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{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();
}
POST
{{apiurl}}/api/{{api-version}}/database/suppressrecipientglobally
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"EmailAddress":"recipient1@example.com"}
{
"Message": "Recipient suppressed successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/database/suppressrecipientglobally")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""EmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/database/suppressrecipientglobally');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"EmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getadhocfieldsbydcformid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"DCFormID":"FRM10003T3CON1168","PageNumber":"1","PageSize":"10"}
{
"Total Record(s)": "3",
"Results": [
{
"DCFormID": "FRM10003T3CON1168",
"AdhocFieldID": "1I9E",
"AdhocFieldName": "Last Name",
"AdhocFieldType": "TextBox",
"Required": "No"
},
{
"DCFormID": "FRM10003T3CON1168",
"AdhocFieldID": "1I2E",
"AdhocFieldName": "EmailAddress",
"AdhocFieldType": "TextBox",
"Required": "Yes"
},
{
"DCFormID": "FRM10003T3CON1168",
"AdhocFieldID": "1I1E",
"AdhocFieldName": "First Name",
"AdhocFieldType": "TextBox",
"Required": "No"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getadhocfieldsbydcformid")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""DCFormID"":""FRM10T3CON49"",""PageNumber"":""1"",""PageSize"":""30""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getadhocfieldsbydcformid');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"DCFormID":"FRM10T3CON49","PageNumber":"1","PageSize":"30"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}
{
"DataCaptureFormID": "FRM10003T3CON1168",
"DataCaptureFormName": "Personalisation Testing",
"PageTitle": "Personalisation Testing",
"EditorType": "Drag & Drop Editor",
"RedirectUrl": "",
"DateStatus": "No",
"StartDate": "",
"EndDate": "",
"DataCaptureUrl": "https://devssl.cmadvantage.co.uk/CDD3841028-Z-Z-7-Z-0-3-FRM10003T3CON1168-0-0-Z-Z-Z-Z-Z-Z"
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformdetailsbydcformid/{{DCFormId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureformresults
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"DCFormID":"FRM10003T3CON1168","StartDate":"2023-05-01","EndDate":"2023-05-04"}
{
"Results": [
{
"First Name": "recipient1",
"Email Address": "recipient1@example.com",
"Occured At": "02/05/2023 12:13:20"
},
{
"First Name": "recipient2",
"Email Address": "recipient2@example.com",
"Occured At": "02/05/2023 12:13:12"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformresults")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""DCFormID"":""FRM10T3CON49"",""StartDate"":""2023-05-01"",""EndDate"":""2024-05-04""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureformresults');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"DCFormID":"FRM10T3CON49","StartDate":"2023-05-01","EndDate":"2024-05-04"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/datacaptureform/getdatacaptureforms
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"Pagenumber":"1","PageSize":"1"}
{
"Total Record(s)": "1",
"Results": [
{
"DataCaptureFormID": "FRM10003T3CON1168",
"DataCaptureFormName": "test form",
"PageTitle": "test form",
"EditorType": "Drag & Drop Editor",
"RedirectUrl": "",
"DateStatus": "No",
"StartDate": "",
"EndDate": "",
"DataCaptureUrl": "https://devssl.cmadvantage.co.uk/CDD3841028-Z-Z-7-Z-0-3-FRM10003T3CON1168-0-0-Z-Z-Z-Z-Z-Z"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureforms")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Pagenumber"":""1"",""PageSize"":""10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/datacaptureform/getdatacaptureforms');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Pagenumber":"1","PageSize":"10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressadd
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddress":"recipient@example.com"}
{
"Message": "Redirect email added successfully."
}
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressadd")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromAddressName"":""recipient@example.com"",""FromAddressDomain"":""testing.example.com"",""RedirectEmailAddress"":""recipient1@example.com""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressadd');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromAddressName":"recipient@example.com","FromAddressDomain":"testing.example.com","RedirectEmailAddress":"recipient1@example.com"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
DEL
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressdelete/{{AliasId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressdelete/{{AliasId}}
{
"Message": "Email alias deleted successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressdelete/{{AliasId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressdelete/{{AliasId}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PUT
{{apiurl}}/api/{{api-version}}/emailalias/redirectemailaddressedit
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddress":"recipient1@example.com","RedirectEmailAddressID":"11"}
{
"Message": "Redirect email updated successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddressedit")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""FromAddressName"":""recipient"",""FromAddressDomain"":""example.com"",""RedirectEmailAddressID"":""7""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddressedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"FromAddressName":"recipient","FromAddressDomain":"example.com","RedirectEmailAddressID":"7"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/emailalias/redirectemailaddresslist
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": [
{
"RedirectEmailID": "2",
"RedirectEmailAddress": "recipient@example.com",
"FromAddress": "recipient",
"DomainName": "domain.example.com",
"CreatedDate": "21/04/2023 15:51"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/emailalias/redirectemailaddresslist")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/emailalias/redirectemailaddresslist');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
DEL
{{apiurl}}/api/{{api-version}}/jobs/jobdelete/{{JobId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/jobs/jobdelete/{{JobId}}
{
"Message": "Template deleted successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobdelete/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobdelete/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/jobs/jobdetailsfetchbyid/{{JobID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/jobs/jobdetailsfetchbyid/{{JobID}}
{
"Results": {
"JobID": "58182",
"JobType": "Recipients Import",
"FileName": "import_rejected_test.txt",
"ListName": "User 1 - List 2 - Deleted on 17/08/2023 by super super",
"Status": "Successful",
"QueuedAt": "16/08/2023 16:43",
"StartDateTime": "16/08/2023 16:43",
"EndDateTime": "16/08/2023 16:43",
"A.TotalInserted": "0",
"B.TotalUpdated": "0",
"C.TotalRejected": "1",
"D.TotalDuplicates": "0",
"TotalImported(A+B)": "0",
"TotalRecipients(A+B+C+D)": "1"
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobdetailsfetchbyid/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobdetailsfetchbyid/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/jobs/joblistforcampaignschedulefetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Total Record(s)": "228",
"Results": [
{
"JobID": "58552",
"JobType": "Resend to Non-Opens",
"ScheduledFor": "31/08/2023 00:00:00",
"Name": "Resend Non Open Subject - Resend to Non-Opens",
"Status": "Successful",
"QueuedAt": "30/08/2023 14:58",
"StartDateTime": "31/08/2023 00:00",
"EndDateTime": "31/08/2023 00:00",
"TotalMessage(s)Sent": "1"
},
{
"JobID": "58551",
"JobType": "Regular Campaign Launch",
"Name": "Resend Non Open Subject",
"Status": "Successful",
"QueuedAt": "30/08/2023 14:58",
"StartDateTime": "30/08/2023 14:58",
"EndDateTime": "30/08/2023 14:58",
"TotalMessage(s)Sent": "1"
},
{
"JobID": "11424",
"JobType": "Regular Campaign Launch",
"Name": "Campaign 1",
"Status": "Successful",
"QueuedAt": "11/04/2022 12:57",
"StartDateTime": "11/04/2022 12:57",
"EndDateTime": "11/04/2022 12:57",
"TotalMessage(s)Sent": "3"
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/joblistforcampaignschedulefetch")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/joblistforcampaignschedulefetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/jobs/joblistforrecipientsimportfetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Total Record(s)": "2",
"Results": [
{
"JobID": "58182",
"JobType": "Recipients Import",
"FileName": "import_rejected_test.txt",
"ListName": "User 1 - List 2 - Deleted on 17/08/2023 by super super",
"Status": "Successful",
"QueuedAt": "16/08/2023 16:43",
"StartDateTime": "16/08/2023 16:43",
"EndDateTime": "16/08/2023 16:43",
"A.TotalInserted": "0",
"B.TotalUpdated": "0",
"C.TotalRejected": "1",
"D.TotalDuplicates": "0",
"TotalImported(A+B)": "0",
"TotalRecipients(A+B+C+D)": "1"
},
{
"JobID": "11421",
"JobType": "Recipients Import",
"FileName": "Import.csv",
"ListName": "Import List",
"Status": "Successful",
"QueuedAt": "11/04/2022 12:40",
"StartDateTime": "11/04/2022 12:40",
"EndDateTime": "11/04/2022 12:40",
"A.TotalInserted": "3",
"B.TotalUpdated": "0",
"C.TotalRejected": "0",
"D.TotalDuplicates": "0",
"TotalImported(A+B)": "3",
"TotalRecipients(A+B+C+D)": "3"
}
]
}
var options = new RestClientOptions("{{api-url}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{api-version}}/jobs/joblistforrecipientsimportfetch", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/joblistforrecipientsimportfetch');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimport
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ListID": "EL3CUI494",
"FileName": "APII.csv",
"UseDefaultSetting" : "TRUE",
"Data": [
"EmailAddress,First Name ",
"recipient1@recipientjobimport.com,recipient1\r\nrecipient2@recipientjobimport.com,recipient2"
]
}
{
"JobID": "56042",
"Message": "Job created successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/JobRecipientsImport")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{
" + "\n" +
@" ""ListID"": ""EL3CUI494"",
" + "\n" +
@" ""FileName"": ""APII.csv"",
" + "\n" +
@" ""UseDefaultSetting"" : ""TRUE"",
" + "\n" +
@" ""Data"": [
" + "\n" +
@" ""EmailAddress,First Name "",
" + "\n" +
@" ""recipient1@recipientjobimport.com,recipient1""
" + "\n" +
@" ]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/JobRecipientsImport');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "ListID": "EL3CUI494",
\n "FileName": "APII.csv",
\n "UseDefaultSetting" : "TRUE",
\n "Data": [
\n "EmailAddress,First Name ",
\n "recipient1@recipientjobimport.com,recipient1"
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportwithdelimiter
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ListID": "EL3CUI494",
"FileName": "SQLAPI.csv",
"UseDefaultSetting": "TRUE",
"Delimiter": ",",
"Data": [
"EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2",
"recipient1@recipientjobimport.com,779412345627,recipient1,null, null",
"recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1"
]
}
{
"JobID": "56042",
"Message": "Job created successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/JobRecipientsImportWithDelimiter")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{
" + "\n" +
@" ""ListID"": ""EL3CUI494"",
" + "\n" +
@" ""FileName"": ""SQLAPI.csv"",
" + "\n" +
@" ""UseDefaultSetting"": ""TRUE"",
" + "\n" +
@" ""Delimiter"": "","",
" + "\n" +
@" ""Data"": [
" + "\n" +
@" ""EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2"",
" + "\n" +
@" ""recipient1@recipientjobimport.com,779412345627,recipient1,null, null"",
" + "\n" +
@" ""recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1""
" + "\n" +
@" ]
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/JobRecipientsImportWithDelimiter');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{
\n "ListID": "EL3CUI494",
\n "FileName": "SQLAPI.csv",
\n "UseDefaultSetting": "TRUE",
\n "Delimiter": ",",
\n "Data": [
\n "EmailAddress,SMS,First Name, Date of Birth, CheckBox Field2",
\n "recipient1@recipientjobimport.com,779412345627,recipient1,null, null",
\n "recipient2@recipientjobimport.com,null,recipient2,12/12/2012,1"
\n ]
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{{apiurl}}/api/{{api-version}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}
{
"Total Record(s)": "2",
"Results": [
{
"RecipientID": "RCP2I130234O743",
"EmailAddress": "recipient1@recipientjobimport.com",
"ImportStatus": "Add",
"ModifiedDate": "11/01/2024 "
},
{
"RecipientID": "RCP2I130235O743",
"EmailAddress": "recipient2@recipientjobimport.com",
"ImportStatus": "Add",
"ModifiedDate": "11/01/2024 "
}
]
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/jobs/jobrecipientsimportedrecipientlist/{{JobID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
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
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID": "CMP162CON1188",
"CampaignDescription": "SMS API",
"CampaignName": "SMS API",
"RecipientSelected": "1",
"TotalSMSSent": "1",
"FailedMessages": "0",
"TotalUnsubscribes": "0",
"TotalReplies": "0"
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignactivityfetchbyid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignattachlist
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP161CON1187","ListID":"EL1CUI1"}
{
"Message": "List attached successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignattachlist")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""ListID"":""EL1CUI1""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignattachlist');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","ListID":"EL1CUI1"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaigncreate
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"campaignName":"SMS Through API1","campaigndescription":"SMS Through API'"}
{
"CampaignID": "CMP161CON1187",
"CampaignName": "SMS Through API1",
"CampaignDescription": "SMS Through API'",
"CreatedDate": "11/05/2023 14:51",
"ModifiedDate": "11/05/2023 14:51",
"Message": "SMS campaign created successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigncreate")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""campaignName"":""SMS Through API1"",""campaigndescription"":""SMS Through API'""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigncreate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"campaignName":"SMS Through API1","campaigndescription":"SMS Through API\'"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignedit
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP148CON270","validityInHours":"24","CharacterSet":"unicode","AllowExtendedMsg":"0","Message":"Test SMS1"}
{
"CampaignID": "CMP161CON1187",
"CampaignName": "SMS Through API1",
"CampaignDescription": "",
"CreatedDate": "11/05/2023 14:51",
"ModifiedDate": "11/05/2023 14:52",
"Message": "SMS campaign updated successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignedit")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP148CON270"",""validityInHours"":""24"",""CharacterSet"":""unicode"",""AllowExtendedMsg"":""0"",""Message"":""Test SMS1""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignedit');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP148CON270","validityInHours":"24","CharacterSet":"unicode","AllowExtendedMsg":"0","Message":"Test SMS1"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": {
"CampaignID": "CMP161CON1187",
"CampaignName": "SMS Through API1",
"CampaignDescription": "SMS Through API'",
"CreatedDate": "11/05/2023 14:51",
"ModifiedDate": "11/05/2023 14:52",
"TextContent": "API SMS",
"TemplateID": "",
"Validity": "1",
"CharacterSet": "1",
"AllowExtendedMsg": "False",
"ReplyTypeID": null,
"ReplyText": null
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignfetchbyid/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"TestMessageStatus": "Delivery failure - expiration time exceeded"
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigngetteststatus/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignlaunchimmediately
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID" : "CMP161CON1187"}
{
"Message": "Campaign launched successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignlaunchimmediately")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"" : ""CMP161CON1187""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignlaunchimmediately');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID" : "CMP161CON1187"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"CampaignID": "CMP162CON1188",
"CampaignName": "SMS Through API",
"CampaignDescription": "SMS Through API'",
"SMSCampaignReplies": []
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignrecipientreplyfetch/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PUT
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignreplyoptionsadd
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP161CON1187","ReplyTypeID":"1","ReplyText":"Thank You!"}
{
"CampaignID": "CMP161CON1187",
"CampaignName": "SMS Through API1",
"CampaignDescription": "",
"CreatedDate": "11/05/2023 14:51",
"ModifiedDate": "11/05/2023 14:52",
"Message": "SMS campaign updated successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignreplyoptionsadd")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""ReplyTypeID"":""1"",""ReplyText"":""Thank You!""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignreplyoptionsadd');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","ReplyTypeID":"1","ReplyText":"Thank You!"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignschedule
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID" : "CMP162CON1188","ScheduleDateTime":"2023-05-11 15:10"}
{
"Message": "Campaign launched successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignschedule")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"" : ""CMP162CON1188"",""ScheduleDateTime"":""2023-05-11 15:10""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignschedule');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID" : "CMP162CON1188","ScheduleDateTime":"2023-05-11 15:10"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
POST
{{apiurl}}/api/{{api-version}}/smscampaigns/smscampaignsendtest
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"CampaignID":"CMP161CON1187","TestNumber":"07494186644"}
{
"Message": "Test sms sent successfully."
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaignsendtest")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""CampaignID"":""CMP161CON1187"",""TestNumber"":""07412121212""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaignsendtest');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"CampaignID":"CMP161CON1187","TestNumber":"07494186644"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{api-url}}/api/{{api-version}}/smscampaigns/smscampaigntextget/{{CampaignId}}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Results": {
"CampaignID": "CMP161CON1187",
"CampaignName": "SMS Through API1",
"CampaignDescription": "SMS Through API'",
"TextContent": "API SMS",
"CreatedDate": "11/05/2023 14:51",
"ModifiedDate": "11/05/2023 14:52"
}
}
var options = new RestClientOptions("{{APIURLWITHVERSION}}/smscampaigns/smscampaigntextget/{{CampaignId}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURLWITHVERSION}}/smscampaigns/smscampaigntextget/{{CampaignId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
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();
}
POST
{{apiurl}}/api/{{api-version}}/templates/templatehtmlcontentbyname
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"TemplateName":"TestTemplate"}
{
"TemplateID": "TMP2CON2",
"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/templatehtmlcontentbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateName"":""TestTemplate""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatehtmlcontentbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateName":"TestTemplate"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{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",
"TEXT Content": "Text 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();
}
POST
{{apiurl}}/api/{{api-version}}/templates/templatetextcontentbyname
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{"TemplateName":"TestTemplate"}
{
"TemplateID": "TMP2CON2",
"Text Content": "Text content of a template"
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/templates/templatetextcontentbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""TemplateName"":""TestTemplate""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/templates/templatetextcontentbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"TemplateName":"TestTemplate"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
GET
{{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();
}
{{api-url}}/api/{{api-version}}/module/channel/create
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Name":"Channel A",
"Description":"Channel A Description"
}
{
"ID": "9",
"Name": "Channel A",
"Description": "Channel A Description",
"CreatedDate": "18/10/2024",
"ModifiedDate": "18/10/2024",
"Message": "Channel created successfully."
}
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/create", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel A"",""Description"":""Channel A Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/create');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel1","Description":"Channel1 Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{api-url}}/api/{{api-version}}/module/channel/updatebyid
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ID":"9",
"Name":"Channel D"
"Description":"Channel D Description"
}
{
"ID": "9",
"Name": "Channel D",
"Description": "Channel D Description",
"CreatedDate": "18/10/2024",
"ModifiedDate": "18/10/2024",
"Message": "Channel updated successfully."
}
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/updatebyid", Method.Get);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ID"":""9"",""Name"":""Channel D"",""Description"":""Channel D Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/updatebyid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ID":"9","Name":"Channel D","Description":"Channel D Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{api-url}}/api/{{api-version}}/module/channel/updatebyname
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ExistingChannelName":"Channel D",
"NewChannelName":"Channel A",
"ChannelDescription":"Channel A Description"
}
{
"ID": "9",
"Name": "Channel A",
"Description": "Channel A Description",
"CreatedDate": "18/10/2024",
"ModifiedDate": "18/10/2024",
"Message": "Channel updated successfully."
}
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/updatebyname", Method.Get);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ExistingChannelName"":""Channel D"",""NewChannelName"":""Channel A"",""ChannelDescription"":""Channel A Description""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/updatebyid');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ExistingChannelName":"Channel D","NewChannelName":"Channel A","ChannelDescription":"Channel A Description"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{api-url}}/api/{{api-version}}/module/channel/deletebyid/{channelid}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Message": "Channel deleted successfully."
}
var options = new RestClientOptions("{{apiurl}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{apiversion}}/module/channel/deletebyid/{channelid}", Method.Delete);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiurl}}/api/{{apiversion}}/module/channel/deletebyid/{channelid}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/Channel/DeleteByName
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Name":"Channel A"
}
{
"Message": "Channel deleted successfully."
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/Channel/DeleteByName", Method.Delete);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel A""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/Channel/DeleteByName');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel A"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/fetch
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"PageNumber":"1",
"PageSize":"2",
"Criteria":
{"FieldName":"ChannelName","Operator":"contains","FieldValue":"channel"}
}
{
"Total Record(s)": "2",
"Results": [
{
"ID": "5",
"Name": "Channel B",
"Descripion": "",
"CreatedDate": "18/10/2024",
"ModifiedDate": "18/10/2024"
},
{
"ID": "4",
"Name": "Channel A1",
"Descripion": "Channel A1 Description",
"CreatedDate": "18/10/2024",
"ModifiedDate": "18/10/2024"
}
]
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetch", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{ ""PageNumber"":""1"",""PageSize"":""2"",
" + "\n" +
@"""Criteria"":
" + "\n" +
@"{""FieldName"":""ChannelName"",""Operator"":""contains"",""FieldValue"":""channel""}}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetch');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{ "PageNumber":"1","PageSize":"2",
\n"Criteria":
\n{"FieldName":"ChannelName","Operator":"contains","FieldValue":"channel"}}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/fetchbyid/{channelid}
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ID": "1",
"Name": "Newsletters",
"Descripion": "Newsletters",
"CreatedDate": "25/04/2024",
"ModifiedDate": "25/04/2024"
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetchbyid/{channelid}", Method.Get);
request.AddHeader("Authorization", "Bearer {{token}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetchbyid/{channelid}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{token}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/fetchbyname
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"Name":"Channel D"
}
{
"ID": "9",
"Name": "Channel D",
"Description": "Channel D Description",
"CreatedDate": "21/10/2024",
"ModifiedDate": "21/10/2024"
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/fetchbyname", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""Name"":""Channel D""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/fetchbyname');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"Name":"Channel D"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/suppression/recipientlistfetch
{
"PageNumber":"1",
"PageSize":"2",
"Criteria":
{"FieldName":"SuppressedVia","FieldValue":"manual"}
}
{
"Total Record(s)": "2",
"Results": [
{
"SuppressedAddress": "Recipient1@demo.com",
"SuppressedChannel": "Newsletters",
"SuppressesVia": "Manual",
"SuppressedBy": "John Doe",
"DateSuppressed": "18/10/2024"
},
{
"SuppressedAddress": "Recipient2@demo.com",
"SuppressedChannel": "Newsletters",
"SuppressesVia": "Manual",
"SuppressedBy": "John Smith",
"DateSuppressed": "20/09/2024"
}
]
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/recipientlistfetch", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", {{token}});
var body = @"{""PageNumber"":""1"",""PageSize"":""2"",""ChannelName"":""Newsletters1"",""Criteria"":{""FieldName"":""SuppressedVia"",""FieldValue"":""manual""}}";
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/recipientlistfetch');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"PageNumber":"1","PageSize":"2","ChannelName":"Newsletters1","Criteria":{"FieldName":"SuppressedVia","FieldValue":"manual"}}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/suppression/recipientsadd
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ChannelName":"Newsletters",
"EmailAddress":"demo@campaignmaster.co.uk"
}
{
"Message": "Recipient(s) added to the channel suppression successfully."
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/recipientsadd", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{ ""ChannelName"":""Newsletters"",""EmailAddress"":""demo@campaignmaster.co.uk""} ";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/recipientsadd');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{ "ChannelName":"Channel B11","EmailAddress":"demo@campaignmaster.co.uk"} ');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
{{apiurl}}/api/{{api-version}}/module/channel/suppression/removebyemailaddress
Content-Type : application/json
// Authorization: Bearer {{token}}
string token
{
"ChannelName":"Newsletters","EmailAddress":"demo@campaignmaster.co.uk"
}
{
"Message": "Recipient removed from newsletters channel suppression successfully"
}
var options = new RestClientOptions("{{APIURL}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/{{APIVERSION}}/module/channel/suppression/removebyemailaddress", Method.Delete);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{token}}");
var body = @"{""ChannelName"":""Newsletters"",""EmailAddress"":""gunjan.gupta@campaignmaster.co.uk""}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{APIURL}}/api/{{APIVERSION}}/module/channel/suppression/removebyemailaddress');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{token}}'
));
$request->setBody('{"ChannelName":"Newsletters","EmailAddress":"demo@campaignmaster.co.uk"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}