Get a list of SubAccounts.
GET
/Users/SubAccounts/
curl GET 'https://api.mailmailmail.net/v2.0/Users/SubAccounts?limit=10&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$limit = 10;
$offset = 0;
$result = $parser->GetSubAccounts($limit, $offset);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
int limit = 10;
int offset = 0;
string result = parser.GetSubAccounts(limit, offset);
{
"status": true,
"code": 200,
"data": [{
"groupid": "249",
"username": "sub_account5988",
"status": "1",
"fullname": "sub_account5988",
"ownerEmail": "sub_account@email.com",
"phone": "",
"usertimezone": "Europe/Skopje",
"createdate": "1616760620",
"lastloggedin": "1616744533"
}, {
"groupid": "250",
"username": "sub_account_filip",
"status": "1",
"fullname": "Filip",
"ownerEmail": "example@email.com",
"phone": "",
"usertimezone": "Europe/Skopje",
"createdate": "1616760620",
"lastloggedin": "1616744533"
}]
}
{
"status": false,
"code": 401,
"message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}
Create sub account from your admin account.
POST
/Users/SubAccounts/
curl POST 'https://api.mailmailmail.net/v2.0/Users/SubAccounts' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"accountName":"test-account_4","accountPassword":"password","ownerEmail":"test@localhost.com","allowedDomains":["@localhost.com","@some_dk.com"]}'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "test-account_4";
$accountPassword = "password";
$ownerEmail = "test@localhost.com";
$allowedDomains = array("@localhost.com, some_dk.com");
$result = $parser->CreateSubAccount($accountName, $accountPassword, $ownerEmail, $allowedDomains);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "test-account_4";
string accountPassword = "password";
string ownerEmail = "test@example.com";
string[] allowedDomains = {"@example.com"};
string result = parser.CreateSubAccount(accountName, accountPassword, ownerEmail, allowedDomains);
{
"status":true,
"code":201
"data":{
"message":"New sub account created successfully."
}
}
{
"status":false,
"code":400,
"message":"Parameter ownerEmail is empty."
}
Activate/Deactivate SubAccount.
PUT
/Users/SubAccounts/
curl PUT 'https://api.mailmailmail.net/v2.0/Users/SubAccounts' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"accountName":"sub_account3265","status":false}'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "sub_account3265";
$status = false; // Active = true; Disabled = false
$result = $parser->SetSubAccountStatus($accountName, $status);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "sub_account3265";
bool status = false; // Active = true; Disabled = false
string result = parser.SetSubAccountStatus(triggerid, status);
{
"status":true,
"code":200,
"data":{
"message":"Sub account has been updated"
}
}
{
"status":false,
"code":400,
"message":"Parameter accountName is empty"
}
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritLists?accountName=sub_account_name&limit=10&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "sub_account_name";
$limit = 10;
$offset = 0;
$result = $parser->GetInheritedLists($accountName, $limit, $offset);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = 'sub_account_name';
int limit = 10;
int offset = 0;
string result = parser.GetInheritedLists(accountName, limit, offset);
{
"status": true,
"code": 200,
"data": [{
"listid": "7608",
"listName": "Test_Case_List_Denmark_11815114",
"descriptiveName": "Description 1",
"ownername": "Denis Green",
"owneremail": "some@ownerDK.com",
"replytoemail": "some@ownerDK.com",
"companyname": "",
"companyemail": "",
"companyaddress": "",
"companyphone": "",
"subscribecount": "0",
"unsubscribecount": "0",
"bouncecount": "0",
"deleted": "0",
"smssubscribecount": "0",
"sms_prefix": ""
}, {
"listid": "7609",
"listName": "Test_Case_List_Denmark_81059802",
"descriptiveName": "Description 2",
"ownername": "Denis Bank",
"owneremail": "some2@ownerDK.com",
"replytoemail": "some2@ownerDK.com,
"companyname": "",
"companyemail": "",
"companyaddress": "",
"companyphone": "",
"subscribecount": "0",
"unsubscribecount": "0",
"bouncecount": "0",
"deleted": "0",
"smssubscribecount": "0",
"sms_prefix": ""
}]
}
{
"status": false,
"code": 401,
"message": "Specified account is not your sub account."
}
Inherit lists from your admin account to sub account.
PUT
/Users/InheritLists/
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritLists' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"accountName":"InheritLists_Test","inheritLists":[234,23452,3123,32]}'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritLists_Test";
$inheritLists = array(1,2);
$result = $parser->InheritListsToSubAccount($accountName, $inheritLists);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "InheritLists_Test";
int[] inheritLists = new int[] {1, 2};
string result = parser.InheritListsToSubAccount(accountName, inheritLists);
{
"status":true,
"code":200
"data":{
"message":"Inherit successful."
}
}
{
"status":false,
"code":401,
"message":"Specified account is not your sub account"
}
Delete Inherit Lists for specific sub account
DELETE
/Users/InheritLists/
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritLists/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '[{"accountName":"InheritLists_Test"},{"listid":12}]'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritLists_Test";
$listid = 12;
$result = $parser->RemoveInheritedList($accountName, $listid);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = 'InheritLists_Test';
int listid = 12;
string result = parser.RemoveInheritedList(accountName, listid);
{
"status":true,
"code":200,
"data":{
"message":"Inherited list has been deleted."
}
}
{
"status":false,
"code":403,
"message":"This user is not owner of the list"
}
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritSegments?accountName=sub_account_name&limit=10&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "sub_account_name";
$limit = 10;
$offset = 0;
$result = $parser->GetInheritedSegments($accountName, $limit, $offset);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = 'sub_account_name';
int limit = 1;
int offset = 0;
string result = parser.GetInheritedSegments(accountName, limit, offset);
{
"status":true,
"code":200,
"data":[
{
"segmentid":1,
"segmentname":"Test GetStatidsBySegment",
"createdate":1580307521,
"updatedate":1580307521,
"usedlists":[
9
],
"otmrule":0,
"wtrrule":0,
"searchinfo":{
"Lists":[
[
9
]
],
"Rules":[
[
{
"type":"group",
"rules":[
{
"type":"rule",
"connector":"and",
"rules":{
"ruleName":"email",
"ruleOperator":"like",
"ruleValues":[
"toni"
]
}
}
],
"connector":"and"
}
]
],
"Operators":null
}
}
]
}
{
"status": false,
"code": 401,
"message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}
Inherit segments to sub account.
PUT
/Users/InheritSegments/
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritSegments' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"accountName":"InheritSegments_Test","inheritSegments":[23,442,1234]}'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritSegments_Test";
$inheritSegments = array(1, 2);
$result = $parser->InheritSegmentsToSubAccount($accountName, $inheritSegments);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "InheritSegments_Test";
int[] inheritSegments = new int[] {1, 2};
string result = parser.inheritSegments(accountName, inheritSegments);
{
"status":true,
"code":201
"data":{
"message":"Inherit successful."
}
}
{
"status":false,
"code":400,
"message":"Parameter accountName is empty."
}
Delete Inherited Segment from Specific account
DELETE
/Users/InheritSegments/
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritSegments/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '[{"accountName":"InheritSegments_Test"},{"segmentid":12}]'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritSegments_Test";
$segmentid = 12;
$result = $parser->RemoveInheritedSegment($accountName, $segmentid);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = 'InheritSegments_Test';
int segmentid = 12;
string result = parser.RemoveInheritedSegment(accountName, segmentid);
{
"status":true,
"code":200,
"data":{
"message":"Inherited segment has been deleted."
}
}
{
"status":false,
"code":403,
"message":"Only inherit segments can be deleted."
}
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters?accountName=sub_account_name&limit=10&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "sub_account_name";
$limit = 10;
$offset = 0;
$result = $parser->GetInheritedNewsletters($accountName, $limit, $offset);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = 'sub_account_name';
int limit = 10;
int offset = 0;
string result = parser.GetInheritedNewsletters(accountName, limit, offset);
{
"status":true,
"code":200,
"data":[
{
"newsletterid":"1",
"name":"Newsletter name",
"subject":"Newsletter subject",
"createdate":"1613119186",
"active":"1",
"updatedate":"1616410086",
"selectedlists":[
"6"
],
"selectedsegments":[
],
"url":"https://app.marketingplatform.com/display.php?N=1&T=933c3640325"
},
{
"newsletterid":"2",
"name":"Newsletter name 2",
"subject":"Newsletter subjects 2",
"createdate":"1613119194",
"active":"1",
"updatedate":"1613120415",
"selectedlists":[
"6"
],
"selectedsegments":[
],
"url":"https://app.marketingplatform.com/display.php?N=2&T=933c3640325"
}
]
}
{
"status": false,
"code": 401,
"message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}
Inherit newsletter to sub account.
PUT
/Users/InheritNewsletters/
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"accountName":"InheritNewsletter_Test","newsletterid":123,"recipientsType":"segment","recipeintsid":[23,55,23,5232]}'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritNewsletter_Test";
$newsletterid = 123;
$recipientsType = "segment";
$recipeintsid = array(1, 2);
$result = $parser->InheritNewsletterToSubAccount($accountName, $newsletterid, $recipientsType, $recipeintsid);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "InheritNewsletter_Test";
int newsletterid = 123;
string recipientsType = "segment";
int[] recipeintsid = new int[] {1, 2};
string result = parser.InheritNewsletterToSubAccount(accountName, newsletterid, recipientsType, recipeintsid);
{
"status":true,
"code":201
"data":{
"message":"Inherit successful."
}
}
{
"status":false,
"code":401,
"message":"Specified account is not your sub account"
}
Delete Inherited Newsletter from Specific Sub Account
DELETE
/Users/InheritNewsletters/
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '[{"accountName":"InheritNewsletter_Test"},{"newsletterid":15}]'
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);
$accountName = "InheritNewsletter_Test";
$newsletterid = 15;
$result = $parser->RemoveInheritedNewsletter($accountName, $newsletterid);
print_r($result);
using MarketingPlatform;
string username = 'API_USERNAME';
string token = 'API_TOKEN';
ApiParser parser = new ApiParser(username, token);
string accountName = "InheritNewsletter_Test";
int newsletterid = 15;
string result = parser.RemoveInheritedNewsletter(accountName, newsletterid);
{
"status":true,
"code":200,
"data":{
"message":"Inherited campaign has been deleted."
}
}
{
"status":false,
"code":400,
"message":"Missing required parameter."
}