VOOZH about

URL: https://api.mailmailmail.net/v2.0/

⇱ API Documentation - MarketingPlatform


  1. 👁 MarketingPlatform logo

  2. Lists

  3. Data Fields

  4. Profiles

  5. Stats

  6. Send

  7. Newsletters

  8. Feeds

  9. Autoresponders

  10. Triggers

  11. Flows

  12. Segments

  13. Users

API v2 Documentation


Request/Response Format

The response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

Some general information about responses:

  • Resource IDs are returned as integers.

  • System dates are returned as timestamp.

  • Blank fields are generally included as null or emtpy string instead of being omitted.


Errors

Occasionally you might encounter errors when accessing the REST API. There are seven possible types:

  • 400 Bad Request - Invalid request, e.g. using an unsupported HTTP method.

  • 401 Unauthorized - Authentication or permission error, e.g. incorrect API keys.

  • 403 Forbidden - The request contained valid data and was understood by the server, but the server is refusing action.

  • 404 Not Found - The requested resource could not be found.

  • 409 Conflict - Indicates that the request could not be processed because of conflict in the current state of the resource.

  • 429 Too Many Requests - The user has sent too many requests in a given amount of time.

  • 500 Internal Server Error - Server Error.


REST API limits

REST API requests of all types and to all endpoints are limited in the following ways:

  • Account - 240 requests per minute.

Exceeding limits

If the quota of requesting a MarketingPlatform API is exceeded, the API returns an error code 429 and a message that the account has exceeded the quota.




Lists

Get Lists

Makes a request call on all the Lists that this user either owns or has access to.

GET

/Lists/

Parameters:
  • Integer
    listid



    List ID to load.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with List details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
 'https://api.mailmailmail.net/v2.0/Lists?listid=0&limit=1&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php"; $settings = array(); $settings['username'] = "API_USERNAME"; $settings['token'] = "API_TOKEN"; $parser = new ApiParser($settings); $listid = 0; // // if listid is set up, then response will be only with selected list data $limit = 100; $offset = 0; $result = $parser->GetLists(listid, $limit, $offset); print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);
		
int listid = 0;
int limit = 100;
int offset = 0;

string result = parser.GetLists(listid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "listid":2,
 "name":"List 1",
 "description":"List 1 description",
 "mobile_prefix":"",
 "sender_name":"test",
 "sender_email":"test@emailplatform.com",
 "reply_email":"test@emailplatform.com",
 "company_name":"",
 "company_email":"test@emailplatform.com",
 "company_address":"",
 "company_phone":"",
 "company_domain":""
 },
 {
 "listid":22,
 "name":"List 2",
 "description":"List 2 description",
 "mobile_prefix":"",
 "sender_name":"Marketing Platform",
 "sender_email":"support@emailplatform.com",
 "reply_email":"support@emailplatform.com",
 "company_name":"",
 "company_email":"support@emailplatform.com",
 "company_address":"",
 "company_phone":"",
 "company_domain":""
 }
 ]
}

Create List

This method creates a List based on the current class variables.

POST

/Lists/

Parameters:
  • String
    name



    List name.
  • String
    description



    List description.
  • String
    mobile_prefix



    Country dialing code.
  • String
    sender_name



    Send from name.
  • String
    sender_email



    Sender from email.
  • String
    reply_email



    Default reply-to email.
  • String
    company_name



    Company name.
  • String
    company_email



    Company email.
  • String
    company_address



    Company address.
  • String
    company_phone



    Country phone.
  • String
    company_domain



    Country domain.
Response:
  • On success:
    HTTP code 200



    JSON object with a newly created list ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Lists' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Create Test List","description":"List description", "mobile_prefix":"389"}'
{
 "name": "Create Test List",
 "description": "List description",
 "mobile_prefix": "45",
 "sender_name":"Marketing Platform",
 "sender_email":"support@marketingplatform.com",
 "reply_email":"support@marketingplatform.com",
 "company_name":"Marketing Platform",
 "company_email":"support@marketingplatform.com",
 "company_address":"Nørregade 12a, 6600 Vejen, Denmark",
 "company_phone":"+4572444444",
 "company_domain":"marketingplatform.com"
}
require_once dirname(__FILE__) . "/ApiParser.class.php"; $settings['username'] = "API_USERNAME"; $settings['token'] = "API_TOKEN"; $parser = new ApiParser($settings); $listName = "Create Test List"; $description = "List description"; $mobilePrefix = "389"; $result = $parser->CreateList($listName, $description, $mobilePrefix); print_r($result);
using MarketingPlatform;

string username = "API_USERNAME";
string token = "API_TOKEN";

ApiParser parser = new ApiParser(username, token);

String listName = "Create Test List";
String description = "List description";
String mobilePrefix = "389";

string result = parser.CreateList(listName, description, mobilePrefix, senderName, senderEmail);

Sample Response


{
 "status":true,
 "code":201,
 "listid":49
}

{
 "status":false,
 "code":400,
 "message":"Parameter name is empty"
}

Add Data Fields To List

This method link data fields to the specific list.

POST

/Lists/AddDataFieldsToList/

Parameters:
  • Integer
    listid



    List ID.
  • Array
    data_fields



    Array of Data Field ids that you want to be added.
Response:
  • On success:
    HTTP code 200



    JSON array with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Lists/AddDataFieldsToList' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":26,"data_fields":[1,2,3,4]}'
{
 "listid": 26,
 "data_fields": [1, 2, 3, 4]
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 26;
$dataFields = array (1, 2, 3, 4);

$result = $parser->AddDataFieldsToList($listid, $dataFields);

print_r($result);
using MarketingPlatform;

string username = "API_USERNAME";
string token = "API_TOKEN";

ApiParser parser = new ApiParser(username, token);

int listid = 26;
int[] datafields = new int[] {1, 2, 3, 4};

string result = parser.AddDataFieldsToList(listid, dataFields);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Data fields have been successfuly added to the list."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Remove Data Fields From List

This method unlink data fields from the specific list.

POST

/Lists/RemoveDataFieldsFromList/

Parameters:
  • Integer
    listid



    List ID.
  • Array
    data_fields



    Array of Data Field ids that you want to be added.
Response:
  • On success:
    HTTP code 200



    JSON array with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Lists/RemoveDataFieldsFromList' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":26,"data_fields":[1,2,3,4]}'
{
 "listid": 26,
 "data_fields": [1, 2, 3, 4]
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 26;
$dataFields = array (1, 2, 3, 4);

$result = $parser->RemoveDataFieldsFromList($listid, $dataFields);

print_r($result);
using MarketingPlatform;

string username = "API_USERNAME";
string token = "API_TOKEN";

ApiParser parser = new ApiParser(username, token);

int listid = 26;
int[] datafields = new int[] {1, 2, 3, 4};

string result = parser.RemoveDataFieldsFromList(listid, dataFields);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Data fields have been successfuly unlink from the list."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Data Fields

Fetches Data Fields for the specific List.

GET

/Lists/GetDataFields/

Parameters:
  • Integer
    listid



    List ID to get data fields.
  • String
    field_type



    Type of data field.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON array with data fields.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Lists/GetDataFields?listid=12&field_type=dropdown' -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);

$listid = 12;
$fieldType = "dropdown";

$result = $parser->GetDataFields($listid, $fieldType);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
string fieldType = "dropdown";

string result = parser.GetDataFields(listid, fieldType);

Sample Response


  {
 "status":true,
 "code":200,
 "data":[
 {
 "fieldid":2,
 "name":"First Name",
 "field_type":"text",
 "default_value":"",
 "settings":{
 "field_length":50,
 "min_length":0,
 "max_length":0,
 "apply_default":""
 }
 },
 {
 "fieldid":11,
 "name":"Gender",
 "field_type":"radiobutton",
 "default_value":"",
 "settings":{
 "options":[
 {
 	 "Male":"Male",
 "Female":"Female"
 }
 ]
 }
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"List 8 does not have data fields"
}

Update List

Updates a current List based on the current class variables.

PUT

/Lists/

Parameters:
  • Integer
    listid



    List ID to be edited.
  • String
    name



    New list name.
  • String
    description



    New list description.
  • String
    mobile_prefix



    New country dialing code.
  • String
    sender_name



    Send from name.
  • String
    sender_email



    Sender from email.
  • String
    reply_email



    Default reply-to email.
  • String
    company_name



    Company name.
  • String
    company_email



    Company phone number.
  • String
    company_address



    Company address.
  • String
    company_phone



    Company phone.
  • String
    company_domain



    Company domain.
Response:
  • On success:
    HTTP code 200



    JSON array with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Lists' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":"26","name":"New list name","description":"New list description","mobile_prefix":"45"}'
{
 "listid": 26,
 "name": "New list name",
 "description": "New list description",
 "mobile_prefix": "45",
 "sender_name":"new sender name Marketing Platform",
 "sender_email":"new sender email support@marketingplatform.com",
 "reply_email":"new reply email support@marketingplatform.com",
 "company_name":"new company name Marketing Platform",
 "company_email":"new comapany email support@marketingplatform.com",
 "company_address":"new address Nørregade 12a, 6600 Vejen, Denmark",
 "company_phone":"+4572444444",
 "company_domain":"new domain marketingplatform.com"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 26;
$listName = "New list name";
$description = "New list description";
$mobilePrefix = "45";

$result = $parser->UpdateList($listid, $listName, $description, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = "API_USERNAME";
string token = "API_TOKEN";



ApiParser parser = new ApiParser(username, token);

int listid = 26;
string listName = "New list name";
string description = "New list description";
string mobilePrefix = "45";

string result = parser.UpdateList(listid, listName, mobilePrefix, senderName);

Sample Response


{
 "status":true,
 "code":200,
 "message": "The selected contact list has been successfully updated."
}

{
 "status":false,
 "code":400,
 "message":"This user is not owner of the list"
}

{
 "status":false,
 "code":400,
 "message":"Mobile prefix is not valid"
}`

Copy List

Copy List details including data fields.

POST

/Lists/CopyList/

Parameters:
  • Integer
    listid



    List ID to be copied.
  • String
    name



    Name of the copied list.
  • String
    description



    Description of the copied list.
Response:
  • On success:
    HTTP code 200



    JSON object with newly created List ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Lists/CopyList' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":26,"name":"Copied list name","description":"Copied list description"}'
{
 "listid": 26,
 "name": "Copied list name",
 "description": "Copied list description"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 26;
$listName = "Copied list name";
$description = "Copied list description";

$result = $parser->CopyList($listid, $listName, $description);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 26;
String listName = "Copied list name";
String description = "Copied list description";

string result = parser.CopyList(listid, listName, description);

Sample Response


{
 "status":true,
 "code":202,
 "listid":55
}

{
 "status":false,
 "code":202,
 "message":"This user is not owner of the list"
}

Delete List

Delete a List from the database.

DELETE

/Lists/

Parameters:
  • Integer
    listid



    List ID to be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Lists?listid=26' -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);
$listid = 26;
$result = $parser->DeleteList($listid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);
int listid = 26;
string result = parser.DeleteList(listid);

Sample Response


[
 "status":true,
 "code":200
 "message": "Profile list has been deleted."
]

Data Fields

Load Data Fields

Loads the data fields.

GET

/DataFields/

Parameters:
  • Integer
    fieldid



    Field ID to load.
  • Boolean
    load_lists



    Whether to return the information which lists are linked with the field.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON array with ID of new created data field and message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET
  'https://api.mailmailmail.net/v2.0/DataFields?fieldid=11&load_lists=true' -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);

$fieldid = 11;
$loadLists = true;

$result = $parser->LoadDataFields($fieldid, $loadLists);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int fieldid = 11;
bool loadLists = true;

string result = parser.LoadDataFields(fieldid, loadLists);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "fieldid":2,
 "name":"First Name",
 "field_type":"text",
 "default_value":"",
 "settings":{
 "field_length":50,
 "min_length":0,
 "max_Length":0,
 "apply_default":""
 },
 "lists":[
 8,
 10
 ]
 }
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the custom field"
}

Create Data Field

Create a new data field.

POST

/DataFields/

Parameters:
  • String
    name



    Name of data field.
  • String
    field_type



    Type of data field. text / textarea / number / dropdown / checkbox / radiobutton / date. Date format should be dd.mm.yyyy
  • String
    default_value



    Default value
  • Array
    settings



    Data field settings. For param display_order in date field are allows following values: d-m-y, m-d-y and y-m-d.
Response:
  • On success:
    HTTP code 200



    JSON object with a newly created data field ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Text_Field","field_type":"text"}'
{
 "name": "Text_Field",
 "field_type": "text"
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Number_Field","field_type":"number","settings":[]}'
{
 "name": "Number_Field",
 "field_type": "number"
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Radio_Field","field_type":"radiobutton","settings":{"options":[{"male":"male","female":"female"}]}}'
{
 "name": "Radio_Field",
 "field_type": "radiobutton",
 "settings":{
 "options":
 {
 "male":"male", 
 "female":"female"
 }
 }
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"CheckBox_Field","field_type":"checkbox","settings":{"options":[{"Red":"Red","Blue":"Blue","Yellow":"Yellow","Black":"Black","Grey":"Grey","White":"White","Silver":"Silver"}]}}'
{
 "name": "CheckBox_Field",
 "field_type": "checkbox",
 "settings": {
 "options":
 {
 "Red":"Red", 
 "Blue":"Blue",
 "Yellow":"Yellow", 
 "Black":"Black",
 "Grey":"Grey", 
 "White":"White",
 "Silver":"Silver"
 }
 }
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Dropdown_Field","field_type":"dropdown","settings":{"options":[{"Monday":"Monday","Tuesday":"Tuesday","Wednesday":"Wednesday","Wednesday":"Wednesday","Friday":"Friday","Saturday":"Saturday","Sunday":"Sunday"}]}}'
{
 "name": "Dropdown_Field",
 "field_type": "dropdown",
 "settings": {
 "options":
 {
 "Monday":"Monday", 
 "Tuesday":"Tuesday",
 "Wednesday":"Wednesday", 
 "Thursday":"Thursday",
 "Friday":"Friday", 
 "Saturday":"Saturday",
 "Sunday":"Sunday"
 }
 }
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Date_Field","field_type":"date","settings":{"display_order_1":"year","display_order_2":"month","display_order_3":"day","start_year":1990,"end_year":2030}}'
{
 "name": "Date_Field",
 "field_type": "date",
 "settings": {
	"display_order": "d-m-y",
	"start_year": 1990,
	"end_year": 2030
 }
}
curl POST 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "MyOneToMany","field_type": "relational","settings": {"FirstName": "Text","MyNumber": "Number","Active": "Bool","UserInfo": {"properties": {"Email": "Text","Lastname": "Text","HasDog": "Bool","DogId": "Number","DogDetails": {"properties": {"DogName": "Text","DogNumber": "Number","isAgresive": "Bool","DOB": "Date"}}}}}}'

 {
 "name": "MyOneToMany",
 "field_type": "relational",
 "settings": {
 "FirstName": "Text",
 "MyNumber": "Number",
 "Active": "Bool",
 "UserInfo": {
 "properties": {
 "Email": "Text",
 "Lastname": "Text",
 "HasDog": "Bool",
 "DogId": "Number",
 "DogDetails": {
 "properties": {
 "DogName": "Text",
 "DogNumber": "Number",
 "isAgresive": "Bool",
 "DOB": "Date"
 }
 }
 }
 }
 }
}
 
 
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "text";
		 
$result = $parser->CreateDataField($fieldName, $fieldType);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "date";
$fieldSettings = array (
 'display_order' => "d-m-Y",
 'start_year' => 1990,
 'end_year' => 2030
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "number";
$fieldSettings = array (
 'max_length' => 50, 
 'min_length' => 10
);
$defaultValue = '50';
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "radiobutton";
$fieldSettings = array (
 'options' => array (
 "male"=>"male",
 "female"=>"female"
 )
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "checkbox";
$fieldSettings = array (
	'options' => array (
		"Monday"=>"Monday",
		"Tuesday"=>"Tuesday",
		"Wednesday"=>"Wednesday",
		"Thursday"=>"Thursday",
		"Friday"=>"Friday",
		"Saturday"=>"Saturday",
		"Sunday"=>"Sunday"
	)
);

$defaultValue = "Monday";
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue, $required);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "dropdown";
$fieldSettings = array (
	'options' => array (
		"Red"=>"Red",
		"Blue"=>"Blue",
		"Yellow"=>"Yellow",
		"Black"=>"Black",
		"Grey"=>"Grey",
		"White"=>"White",
		"Silver"=>"Silver"
	)
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';
DataFieldText fieldType = new DataFieldText();

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of Data field';

DataFieldDate fieldType = new DataFieldDate();

fieldType.settings["display_order"] = "d-m-Y";
fieldType.settings["start_year"] = "1990";
fieldType.settings["end_year"] = "2030";
string defaultValue = "26/05/2020";
	
string result = parser.CreateDataField(fieldName, fieldType, defaultValue);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';

DataFieldNumber fieldType = new DataFieldNumber();
fieldType.settings["max_length"] = "50";
fieldType.settings["min_length"] = "10";

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldRadioButton fieldType = new DataFieldRadioButton();

List

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldCheckBox fieldType = new DataFieldCheckBox();

List

Sample Response


{
 "status":true,
 "code":201,
 "fieldid": 1
}

{
 "status":false,
 "code":409,
 "message":"This field name already exist"
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameter for field settings"
}

Update Data Field

Update data field.

PUT

/DataFields/

Parameters:
  • String
    name



    Name of data field.
  • integer
    fieldid



    Data field ID that will be Updated.
  • String
    default_value



    Default value
  • Array
    settings



    Data field settings.
Response:
  • On success:
    HTTP code 200



    JSON object with a newly created data field ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Text_Field_Update","settings": {"FieldLength": 256,"MinLength": 26,"MaxLength": 78}}'

{
 "name":"Text_Field_Update",
 "settings": {
 "FieldLength": 256,
 "MinLength": 26,
 "MaxLength": 78
 }
}
 	
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Number_Field_Update","settings": {"FieldLength": 2323,"MinLength": 11,"MaxLength": 22}}'

{
 "name": "Number_Field_Update",
 "settings": {
 "FieldLength": 15,
 "MinLength": 2,
 "MaxLength": 10
 }
}
 
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Radio_Field","settings":{"options":{"male":"male", "female":"female"}}}'

{
 "name": "Radio_Field",
 "settings":{
 "options":
 {
 "male":"male", 
 "female":"female"
 }
 }
}
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "CheckBox_Field_Update","settings": {"options":{"Red":"Red","Blue":"Blue","Green":"Green"}}}'

{
 "name": "CheckBox_Field_Update",
 "settings": {
 "options":
 {
 "Red":"Red", 
 "Blue":"Blue",
 "Green":"Green"
 }
 }
}
 
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Dropdown_Field_Update","settings": {"options":{"Apple":"Apple","Orange":"Orange","Banana":"Banana"}}}'

{
 "name": "Dropdown_Field_Update",
 "settings": {
 "options":
 {
 "Apple":"Apple",
 "Orange":"Orange",
 "Banana":"Banana"
 }
 }
}
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Date_Field_2","settings": {"display_order": "m-d-y","start_year": 1999,"end_year": 2020}}'

{
 "name": "Date_Field",
 "settings": {
	"display_order": "d-m-y"
	"start_year": 1990,
	"end_year": 2030
 }
}
Posible date formats : "d-m-y","m-d-y","y-m-d";
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "text";
		 
$result = $parser->CreateDataField($fieldName, $fieldType);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "date";
$fieldSettings = array (
 'display_order' => "d-m-Y",
 'start_year' => 1990,
 'end_year' => 2030
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "number";
$fieldSettings = array (
 'max_length' => 50, 
 'min_length' => 10
);
$defaultValue = '50';
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "radiobutton";
$fieldSettings = array (
 'options' => array (
 "male"=>"male",
 "female"=>"female"
 )
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "checkbox";
$fieldSettings = array (
	'options' => array (
		"Monday"=>"Monday",
		"Tuesday"=>"Tuesday",
		"Wednesday"=>"Wednesday",
		"Thursday"=>"Thursday",
		"Friday"=>"Friday",
		"Saturday"=>"Saturday",
		"Sunday"=>"Sunday"
	)
);

$defaultValue = "Monday";
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue, $required);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "dropdown";
$fieldSettings = array (
	'options' => array (
		"Red"=>"Red",
		"Blue"=>"Blue",
		"Yellow"=>"Yellow",
		"Black"=>"Black",
		"Grey"=>"Grey",
		"White"=>"White",
		"Silver"=>"Silver"
	)
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';
DataFieldText fieldType = new DataFieldText();

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of Data field';

DataFieldDate fieldType = new DataFieldDate();

fieldType.settings["display_order"] = "d-m-Y";
fieldType.settings["start_year"] = "1990";
fieldType.settings["end_year"] = "2030";
string defaultValue = "26/05/2020";
	
string result = parser.CreateDataField(fieldName, fieldType, defaultValue);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';

DataFieldNumber fieldType = new DataFieldNumber();
fieldType.settings["max_length"] = "50";
fieldType.settings["min_length"] = "10";

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldRadioButton fieldType = new DataFieldRadioButton();

List

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldCheckBox fieldType = new DataFieldCheckBox();

List

Sample Response


{
 "status":true,
 "code":201,
 "fieldid": 1
}

{
 "status":false,
 "code":409,
 "message":"This field name already exist"
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameter for field settings"
}

Update Data Field

Update data field.

PUT

/DataFields/

Parameters:
  • String
    name



    Name of data field.
  • integer
    fieldid



    Data field ID that will be Updated.
  • String
    default_value



    Default value
  • Array
    settings



    Data field settings.
Response:
  • On success:
    HTTP code 200



    JSON object with a newly created data field ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"Text_Field_Update","settings": {"FieldLength": 256,"MinLength": 26,"MaxLength": 78}}'

{
 "name":"Text_Field_Update",
 "settings": {
 "FieldLength": 256,
 "MinLength": 26,
 "MaxLength": 78
 }
}
 	
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Number_Field_Update","settings": {"FieldLength": 2323,"MinLength": 11,"MaxLength": 22}}'

{
 "name": "Number_Field_Update",
 "settings": {
 "FieldLength": 15,
 "MinLength": 2,
 "MaxLength": 10
 }
}
 
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Radio_Field","settings":{"options":{"male":"male", "female":"female"}}}'

{
 "name": "Radio_Field",
 "settings":{
 "options":
 {
 "male":"male", 
 "female":"female"
 }
 }
}
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "CheckBox_Field_Update","settings": {"options":{"Red":"Red","Blue":"Blue","Green":"Green"}}}'

{
 "name": "CheckBox_Field_Update",
 "settings": {
 "options":
 {
 "Red":"Red", 
 "Blue":"Blue",
 "Green":"Green"
 }
 }
}
 
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Dropdown_Field_Update","settings": {"options":{"Apple":"Apple","Orange":"Orange","Banana":"Banana"}}}'

{
 "name": "Dropdown_Field_Update",
 "settings": {
 "options":
 {
 "Apple":"Apple",
 "Orange":"Orange",
 "Banana":"Banana"
 }
 }
}
curl --request PUT 'https://api.mailmailmail.net/v2.0/DataFields' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"name": "Date_Field_2","settings": {"display_order": "m-d-y","start_year": 1999,"end_year": 2020}}'

{
 "name": "Date_Field",
 "settings": {
	"display_order": "d-m-y"
	"start_year": 1990,
	"end_year": 2030
 }
}
Posible date formats : "d-m-y","m-d-y","y-m-d";
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "text";
		 
$result = $parser->CreateDataField($fieldName, $fieldType);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "date";
$fieldSettings = array (
 'display_order' => "d-m-Y",
 'start_year' => 1990,
 'end_year' => 2030
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "number";
$fieldSettings = array (
 'max_length' => 50, 
 'min_length' => 10
);
$defaultValue = '50';
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "radiobutton";
$fieldSettings = array (
 'options' => array (
 "male"=>"male",
 "female"=>"female"
 )
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "checkbox";
$fieldSettings = array (
	'options' => array (
		"Monday"=>"Monday",
		"Tuesday"=>"Tuesday",
		"Wednesday"=>"Wednesday",
		"Thursday"=>"Thursday",
		"Friday"=>"Friday",
		"Saturday"=>"Saturday",
		"Sunday"=>"Sunday"
	)
);

$defaultValue = "Monday";
$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings, $defaultValue, $required);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$fieldName = "Name of data field";
$fieldType = "dropdown";
$fieldSettings = array (
	'options' => array (
		"Red"=>"Red",
		"Blue"=>"Blue",
		"Yellow"=>"Yellow",
		"Black"=>"Black",
		"Grey"=>"Grey",
		"White"=>"White",
		"Silver"=>"Silver"
	)
);

$result = $parser->CreateDataField($fieldName, $fieldType, $fieldSettings);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';
DataFieldText fieldType = new DataFieldText();

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of Data field';

DataFieldDate fieldType = new DataFieldDate();

fieldType.settings["display_order"] = "d-m-Y";
fieldType.settings["start_year"] = "1990";
fieldType.settings["end_year"] = "2030";
string defaultValue = "26/05/2020";
	
string result = parser.CreateDataField(fieldName, fieldType, defaultValue);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

string fieldName = 'Name of data field';

DataFieldNumber fieldType = new DataFieldNumber();
fieldType.settings["max_length"] = "50";
fieldType.settings["min_length"] = "10";

string result = parser.CreateDataField(fieldName, fieldType);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldRadioButton fieldType = new DataFieldRadioButton();

List

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';

ApiParser parser = new ApiParser(username, token);
		
string fieldName = 'Name of data field';

DataFieldCheckBox fieldType = new DataFieldCheckBox();

List

Sample Response


{
 "status":true,
 "code":201,
 "fieldid": 1
}

{
 "status":false,
 "code":409,
 "message":"This field name already exist"
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameter for field settings"
}

GetSampleDataForOTM

Get sample data for OtM field.

GET

/DataFields/GetSampleDataForOTM/

Parameters:
  • Integer
    fieldid



    Field ID.
Response:
  • On success:
    HTTP code 200



    Returns JSON object with sample data.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/DataFields/GetSampleDataForOTM?fieldid=14' -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);

$fieldid = 14;

$result = $parser->GetSampleDataForOTM($fieldid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

int fieldid = 14;

string result = parser.GetSampleDataForOTM(fieldid);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "Firstname":"enter text here",
 "ID":"enter number here",
 "DOB":"enter date here",
 "Active":"enter boolean here (true/false)",
 "Orders":[
 {
 "OrderName":"enter text here",
 "OrderID":"enter number here",
 "OrderDate":"enter date here",
 "Send":"enter boolean here (true/false)",
 "Products":[
 {
 "ProductName":"enter text here",
 "ProductId":"enter number here",
 "ProductDate":"enter date here",
 "InStock":"enter boolean here (true/false)"
 },
 {
 "ProductName":"enter text here",
 "ProductId":"enter number here",
 "ProductDate":"enter date here",
 "InStock":"enter boolean here (true/false)"
 }
 ],
 "Parts":{
 "PartName":"enter text here",
 "PartID":"enter number here",
 "PartDate":"enter date here",
 "HavePart":"enter boolean here (true/false)"
 }
 },
 {
 "OrderName":"enter text here",
 "OrderID":"enter number here",
 "OrderDate":"enter date here",
 "Send":"enter boolean here (true/false)",
 "Products":[
 {
 "ProductName":"enter text here",
 "ProductId":"enter number here",
 "ProductDate":"enter date here",
 "InStock":"enter boolean here (true/false)"
 },
 {
 "ProductName":"enter text here",
 "ProductId":"enter number here",
 "ProductDate":"enter date here",
 "InStock":"enter boolean here (true/false)"
 }
 ],
 "Parts":{
 "PartName":"enter text here",
 "PartID":"enter number here",
 "PartDate":"enter date here",
 "HavePart":"enter boolean here (true/false)"
 }
 }
 ],
 "MyCompany":{
 "CompanyName":"enter text here",
 "CompanyID":"enter number here",
 "OpenDate":"enter date here",
 "Working":"enter boolean here (true/false)",
 "MyProducts":[
 {
 "MyProductName":"enter text here",
 "MyProductID":"enter number here",
 "MyProductDate":"enter date here",
 "MyProductInStock":"enter boolean here (true/false)"
 },
 {
 "MyProductName":"enter text here",
 "MyProductID":"enter number here",
 "MyProductDate":"enter date here",
 "MyProductInStock":"enter boolean here (true/false)"
 }
 ],
 "Owners":{
 "OwnerGroup":"enter text here",
 "OwnershipID":"enter number here",
 "OwnedFrom":"enter date here",
 "StillOwning":"enter boolean here (true/false)"
 }
 }
 }
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the field."
}

Delete Data Field

Fetches Data Fields for the specific List.

DELETE

/DataFields/

Parameters:
  • Integer
    fieldid



    Data field ID that will be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with data fields.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/DataFields?fieldid=12' -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);

$fieldid = 12;

$result = $parser->DeleteDataField($fieldid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
ApiParser parser = new ApiParser(username, token);

int fieldid = 12;

string result = parser.DeleteDataField(fieldid);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Data field has been deleted"
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the field."
}

Profiles

Get Profile Details

Get profile data.

GET

/Profiles/GetProfileDetails/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    listid



    List ID.
  • String
    email_address



    Profile’s email address.
  • String
    mobile_number



    Profile’s mobile number.
  • String
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s data.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET
						 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileDetails?profileid=39&listid=2&email_address=contact@marketingplatform.com&mobile_number=72444444&mobile_prefix=45' -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);

$profileid = 39;
$listid = 2;
$emailaddres = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->GetProfileDetails($profileid, $listid, $emailaddress, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 39;
int listid = 2;
string emailaddres = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.GetProfileDetails(profileid, listid, emailaddress, mobileNumber, mobilePrefix);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "profileid":39,
 "listid":2,
 "email_address":"contact@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "domain":"@marketingplatform.com",
 "format":"h",
 "confirmed":false,
 "request_date":1551698732,
 "confirm_date":0,
 "subscribe_date":0,
 "bounced":0,
 "unsubscribed":0,
 "rating":1,
 "disabled":0,
 "sms_unsubscribed":0,
 "leadscore":0,
 "sign_up_source" "Manual", 
 "data_fields": [
 {
 "fieldid": "524",
 "field_name": "Firs tName",
 "field_type": "text",
 "field_value": "Jon"
 },
 {
 "fieldid": "284226",
 "field_name": "AGE",
 "field_type": "number",
 "field_value": 23
 }
 ]
 }
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Add Profile To List

This method adds a profile to a Profile List.

POST

/Profiles/

Wiki Link

Parameters:
  • Integer
    listid



    The List to which the Profile will be added.
  • String
    email_address



    Profile address to be added to the List.
  • String
    mobile_number



    Profile mobile number to be added to the List.
  • String
    mobile_prefix



    Country dialing code.
  • Array
    data_fields



    Array of Data Fields that you want to be added. Relation-OTM fields are not allowed. Date format should be dd.mm.yyyy

    Note: Limit of data fields in array is 50.
  • Boolean
    confirmed



    Set profile status confirmed/unconfirmed. If status is unconfirmed, confirmation email will be sent to the profile.
  • Boolean
    mobile_permission



    Set profile mobile/sms status active/unsubscribe.
  • Boolean
    email_permission



    Set profile email status active/unsubscribe.
  • Boolean
    add_to_autoresponders



    Whether or not to add the profile to the autoresponder.
Response:
  • On success:
    HTTP code 200



    Json object with the new profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST  'https://api.mailmailmail.net/v2.0/Profiles' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":24,"email_address":"contact@marketingplatform.com","mobile_number":"72444444","mobile_prefix":"45","data_fields":[{"fieldid":70,"field_value":123123213}],"confirmed":false,"add_to_autoresponders":false}'
{
	"listid": 24,
	"email_address": "contact@marketingplatform.com",
	"mobile_number": "72444444",
	"mobile_prefix": "45",
	"data_fields": [{
		"fieldid": 70,
		"field_value": 123123213
	}],
	"confirmed": false,
 "mobile_permission": false,
 "email_permission": false
	"add_to_autoresponders": false
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 24;
$emailaddress = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";
$confirmed = false;
$addToAutoreposnders = false;
$dataFields = array ('fieldid' => 70, 'field_value' => 123123213);

$result = $parser->AddProfileToList($listid, $emailaddress, $mobileNumber, $mobilePrefix, $dataFields, $confirmed, $addToAutoreposnders);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 24;
string emailaddress = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";
bool confirmed = false;
bool addToAutoresponders = false;

List<Dictionary<string, object>> dataFields = new List<Dictionary<string, object>>();
Dictionary<string, object> dataField = new Dictionary<string, object>();

dataField.Add("fieldid", "70");
dataField.Add("field_value", "123123123");

dataFields.Add(dataField);

string result = parser.AddProfileToList(listid, emailaddress, mobileNumber, mobilePrefix, confirmed, addToAutoresponders, dataFields);

Sample Response


{
 "status":true
 "code":201,
 "profileid":1098
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameters specified to use this function."
}

Upsert Profile To List

BETA

This method inserts or updates a contact profile based solely on the optional parameters specified in the endpoint definition (such as data fields and consents).

Note: Default consent values, if optional parameters are missing, for very first insert on a new profile:
"confirmed = false" <=> "View Profile Screen → Confirmation status = Unsubscribed"
"email_permission = true" <=> "View Profile Screen → Email Permission = Active"
"mobile_permission = true" <=> "View Profile Screen → Mobile permission = Active"
** In all other cases, consent parameters remain optional.

Note: The endpoint supports updating profile attributes and consent values and can, if explicitly requested, override the customer’s current consent preferences.

POST

/Profiles/UpsertProfileToList

Wiki Link

Parameters:
  • Integer
    listid



    The List to which the Profile will be added.
  • String
    email_address



    Profile address to be added to the List.
  • String
    mobile_number



    Profile mobile number to be added to the List.
  • String
    mobile_prefix



    Country dialing code.
  • Array
    data_fields



    Array of Data Fields that you want to be inserted or updated. Relation-OTM fields are not allowed. Date format should be dd.mm.yyyy

    Note: Limit of data fields in array is 50.
  • Boolean
    confirmed



    Set profile status confirmed/unconfirmed.
  • Boolean
    mobile_permission



    Set profile mobile/sms status active/unsubscribe.
  • Boolean
    email_permission



    Set profile email status active/unsubscribe.
  • Boolean
    add_to_autoresponders



    Whether or not to add the profile to the autoresponder.
Response:
  • On success:
    HTTP code 200



    Json object with the new profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST  'https://api.mailmailmail.net/v2.0/Profiles/UpsertProfileToList' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":24,"email_address":"contact@marketingplatform.com","mobile_number":"72444444","mobile_prefix":"45","data_fields":[{"fieldid":70,"field_value":123123213}],"confirmed":false,"mobile_permission":false,"email_permission":false,"add_to_autoresponders":false}'
{
	"listid": 24,
	"email_address": "contact@marketingplatform.com",
	"mobile_number": "72444444",
	"mobile_prefix": "45",
	"data_fields": [{
		"fieldid": 70,
		"field_value": 123123213
	}],
	"confirmed": false,
 "mobile_permission": false,
 "email_permission": false
	"add_to_autoresponders": false
}

Sample Response


{
 "status":true
 "code":201,
 "profileid":1098
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameters specified to use this function."
}

Update Profile

This method updates profile dataFields.

PUT

/Profiles/UpdateProfile

Parameters:
  • Integer
    profileid



    Which profile to update.
  • Array
    data_fields



    Array with fields that required update. Relation-OTM fields are not allowed.
Response:
  • On success:
    HTTP code 200



    Json object with the new profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT  'https://api.mailmailmail.net/v2.0/Profiles/UpdateProfile' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":1,"profileid":15753,"data_fields":[{"fieldid":"2","field_value":"Name Update"},{"fieldid":"7","field_value":"City Update"}]}'

{
 "profileid": 15753,
 "data_fields": [{
	"fieldid": "2",
	"field_value": "Name Update"
 }, {
	"fieldid": "7",
	"field_value": "City Update"
 }]
}'
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1;
$dataFields = array(
	array(
		'fieldid' => 2,
		'fieldvalue' => "Name Update"
	),
	array(
		'fieldid' => 7,
		'fieldvalue' => "City Update"
	)
);

$result = $parser->UpdateProfile($profileid, $listid, $dataFields);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1;

List<Dictionary<string, object>> dataFields = new List<Dictionary<string, object>>();
Dictionary<string, object> dataField = new Dictionary<string, object>();
Dictionary<string, object> dataField2 = new Dictionary<string, object>();

dataField.Add("fieldid", "2");
dataField.Add("field_value", "Name Update");

dataField2.Add("fieldid", "7");
dataField2.Add("field_value", "City Update");

dataFields.Add(dataField);
dataFields.Add(dataField2);

string result = parser.UpdateProfile(profileid, listid, dataFields);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Profile has been successfully updated"
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameters specified to use this function."
}

Update Profile

This method updates profile dataFields.

PUT

/Profiles

Parameters:
  • Integer
    profileid



    Which profile to update.
  • Array
    data_fields



    Array with fields that required update. Relation-OTM fields are not allowed.
Response:
  • On success:
    HTTP code 200



    Json object with the new profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT  'https://api.mailmailmail.net/v2.0/Profiles' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"listid":1,"profileid":15753,"data_fields":[{"fieldid":"2","fieldvalue":"Name Update"},{"fieldid":"7","fieldvalue":"City Update"}]}'
{
 "profileid": 15753,
 "data_fields": [{
	"fieldid": "2",
	"fieldvalue": "Name Update"
 }, {
	"fieldid": "7",
	"fieldvalue": "City Update"
 }]
}'
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1;
$listid = 1;
$dataFields = array(
	array(
		'fieldid' => 2,
		'fieldvalue' => "Name Update"
	),
	array(
		'fieldid' => 7,
		'fieldvalue' => "City Update"
	)
);

$result = $parser->UpdateProfile($profileid, $listid, $dataFields);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int rofileid = 1;
int listid = 1;

List<Dictionary<string, object>> dataFields = new List<Dictionary<string, object>>();
Dictionary<string, object> dataField = new Dictionary<string, object>();
Dictionary<string, object> dataField2 = new Dictionary<string, object>();

dataField.Add("fieldid", "2");
dataField.Add("field_value", "Name Update");

dataField2.Add("fieldid", "7");
dataField2.Add("field_value", "City Update");

dataFields.Add(dataField);
dataFields.Add(dataField2);

string result = parser.UpdateProfile(profileid, listid, dataFields);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Profile has been successfully updated"
}

{
 "status":false,
 "code":400,
 "message":"Invalid parameters specified to use this function."
}

Delete Profile

All profile information is deleted and email/mobile is restricted from subscribing again - it will not be possible to add this profile again except from ResubscribeProfile that the profile needs to confirm.

DELETE

/Profiles/

Parameters:
  • Integer
    profileid



    Profile ID to delete.
  • Integer
    listid



    List from which to delete profiles.
  • String
    email_address



    Email Address to delete.
  • String
    mobile_number



    Mobile number to delete.
  • String
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json object with status message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE
 		 'https://api.mailmailmail.net/v2.0/Profiles?profileid=62&listid=5&email_address=contact@marketingplatform.com&mobile_number=72444444&mobile_prefix=45' -H
 		 'Apiusername: API_USERNAME' -H 
 		'Apitoken: API_TOKEN' -H
 		 'Content-Type: application/json' -d 
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 62;
$listid = 5;
$emailaddress = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->DeleteProfile($profileid, $listid, $emailaddress, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 62;
int listid = 5;
string emailaddress = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.DeleteProfile(profileid, listid, emailaddress, mobileNumber, mobilePrefix);

Sample Response


{
 "status": true,
 "code": 202,
 "message":"Profile has been successfully deleted"
}

{
 "status":false,
 "code":202,
 "message":"This user is not owner of the list"
}

Load Profile Data Fields

Get a list of data fields for profiles.

GET

/Profiles/LoadProfileDataFields/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    listid



    List ID.
  • String
    email_address



    Email address of profile.
  • String
    mobile_number



    Mobile number of profile.
  • String
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json object with data fields.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/LoadProfileDataFields?profileid=1080&listid=11&email_address=contact@marketingplatform.com&mobile_number=72444444&mobile_prefix=45' -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);

$profileid = 1080;
$listid = 11;
$emailaddres = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->LoadProfileDataFields($profileid, $listid, $emailaddress, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1080;
int listid = 11;
string emailaddres = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.LoadProfileDataFields(profileid, listid, emailaddress, mobileNumber, mobilePrefix);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "fieldid":1,
 "field_value":"",
 "field_name":"Title",
 "field_type":"dropdown"
 },
 {
 "fieldid":2,
 "field_value":"Toni",
 "field_name":"First Name",
 "field_type":"text"
 },
 {
 "fieldid":3,
 "field_value":"Mladenovski",
 "field_name":"Last Name",
 "field_type":"text"
 },
 {
 "fieldid":6,
 "field_value":"11/06/1993",
 "field_name":"Birth Date",
 "field_type":"date"
 },
 {
 "fieldid":7,
 "field_value":"Kumanovo",
 "field_name":"City",
 "field_type":"text"
 },
 {
 "fieldid":10,
 "field_value":"Macedonia",
 "field_name":"Country",
 "field_type":"dropdown"
 },
 {
 "fieldid":11,
 "fieldvalue":"Male",
 "field_name":"Gender",
 "field_type":"radiobutton"
 },
 {
 "fieldid":12,
	"field_value": [
 {
 "value": "green",
 "label": "Green"
 },
 {
 "value": "red",
 "label": "Red"
 }
 ],
 "field_name":"Color",
 "field_type":"checkbox"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"Profile not found."
}

Save Profile Data Field

Saves data field information for particular Profile, particular List and particular Field.

POST

/Profiles/SaveProfileDataField/

Parameters:
  • Integer
    profileid



    Profile ID whose data requires updating.
  • Integer
    fieldid



    Data field ID you are saving.
  • String
    field_value



    New value for Data Field.
  • Boolean
    skip_empty_data



    Process will not be executed if the Field value is empty.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Profiles/SaveProfileDataField' -H 'Apiusername: API_USERNAME'  -H  'Apitoken: API_TOKEN'  -H 'Content-Type: application/json' -d '{"profileid":1097,"fieldid":11,"field_value":"MKD","skip_empty_data":false}'
{
 "profileid": 1097,
 "fieldid": 11,
 "field_value": "MKD",
 "skip_empty_data": false
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 11; // Field ID for Country.
$fieldValue = "MKD"; /* Use 3 letter ISO 3166 international standard
 [Denmark => "DNK", Norway => "NOR"] */
$skipEmptyData = false;

$result = $parser->SaveProfileDataField($profileid, $fieldid, $fieldValue);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 14; 
$fieldValue = array("Fri", "Sun"); /* Use option values. 
 This example will select Fiday and Sunday*/
$skipEmptyData = false;

$result = $parser->SaveProfileDataField($profileid, $fieldid, $fieldValue);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
DataField field = new DataField();
field.fieldid = 11; // Field ID for Country
field.fieldvalue = new string[] { "MKD" }; /* Use 3 letter ISO 3166 international standard
 [Denmark => "DNK", Norway => "NOR"] */
bool skipEmptyData = false;

string result = parser.SaveProfileDataField(profileid, field, skipEmptyData);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
DataField field = new DataField();
field.fieldid = 11; // Field ID for Country
field.fieldvalue = new string[] { "Fri", "Sun" }; /* Use option values. 
 This example will select Fiday and Sunday*/
bool skipEmptyData = false;

string result = parser.SaveProfileDataField(profileid, field, skipEmptyData);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"You have successfully updated profile field"
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Save Profile Data Field

Saves data field information for particular Profile, particular List and particular Field.

PUT

/Profiles/SaveProfileDataField/

Parameters:
  • Integer
    profileid



    Profile ID whose data requires updating.
  • Integer
    fieldid



    Data field ID you are saving.
  • String
    field_value



    New value for Data Field.
  • Boolean
    skip_empty_data



    Process will not be executed if the Field value is empty.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Profiles/SaveProfileDataField' -H 'Apiusername: API_USERNAME'  -H  'Apitoken: API_TOKEN'  -H 'Content-Type: application/json' -d '{"profileid":1097,"fieldid":11,"field_value":"MKD","skip_empty_data":false}'
{
 "profileid": 1097,
 "fieldid": 11,
 "field_value": "MKD",
 "skip_empty_data": false
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 11; // Field ID for Country.
$fieldValue = "MKD"; /* Use 3 letter ISO 3166 international standard
 [Denmark => "DNK", Norway => "NOR"] */
$skipEmptyData = false;

$result = $parser->SaveProfileDataField($profileid, $fieldid, $fieldValue);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 14;
$fieldValue = array("Fri", "Sun"); /* Use option values.
 This example will select Fiday and Sunday*/
$skipEmptyData = false;

$result = $parser->SaveProfileDataField($profileid, $fieldid, $fieldValue);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';


ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
DataField field = new DataField();
field.fieldid = 11; // Field ID for Country
field.fieldvalue = new string[] { "MKD" }; /* Use 3 letter ISO 3166 international standard
 [Denmark => "DNK", Norway => "NOR"] */
bool skipEmptyData = false;

string result = parser.SaveProfileDataField(profileid, field, skipEmptyData);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';


ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
DataField field = new DataField();
field.fieldid = 11; // Field ID for Country
field.fieldvalue = new string[] { "Fri", "Sun" }; /* Use option values.
 This example will select Fiday and Sunday*/
bool skipEmptyData = false;

string result = parser.SaveProfileDataField(profileid, field, skipEmptyData);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"You have successfully updated profile field"
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Load Profile OTM Fields

Get a list of otm fields for profiles.

GET

/Profiles/LoadProfileOTMFields/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    listid



    List ID.
  • String
    email_address



    Profile’s email address.
  • String
    mobile_number



    Profile’s mobile number.
  • String
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json object with otm fields.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/LoadProfileOTMFields?profileid=1080&listid=11&email_address=contact@marketingplatform.com&mobile_number=72444444&mobile_prefix=45' -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);

$profileid = 1080;
$listid = 11;
$emailaddres = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->LoadProfileOTMFields($profileid, $listid, $emailaddress, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 1080;
int listid = 11;
string emailaddres = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.LoadProfileOTMFields(profileid, listid, emailaddress, mobileNumber, mobilePrefix);

Sample Response


							
{
 "status": true,
 "code": 200,
 "data": [
 {
 "fieldid":14,
 "field_value":null,
 "field_name":"Movie",
 "field_type":"Relational"
 },
 {
 "fieldid":17,
 "field_value":{
 "Movie":[
 {
 "Title":"Bohemian Rhapsody",
 "ReleaseDate":"2018-11-02T00:00:00.000+01:00",
 "Actors":[
 {
 "FirstName":"Rami",
 "LastName":"Malek",
 "BirthDate":"1981-05-12T00:00:00.000+02:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Lucy",
 "LastName":"Boynton",
 "BirthDate":"1994-01-17T00:00:00.000+01:00",
 "emp_trigger":0
 }
 ],
 "Oscar":true,
 "Rating":8.4,
 "Premiere":[
 {
 "Country":"Denmark",
 "Cinema":"Cineplexx",
 "PremiereDate":"2018-11-21T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "Country":"Macedonia",
 "Cinema":"Cineplexx",
 "PremiereDate":"2018-11-01T00:00:00.000+01:00",
 "emp_trigger":0
 }
 ],
 "emp_trigger":0
 },
 {
 "Title":"The Prestige",
 "ReleaseDate":"2006-10-20T00:00:00.000+02:00",
 "Actors":[
 {
 "FirstName":"Christian",
 "LastName":"Bale",
 "BirthDate":"1974-01-30T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Hugh",
 "LastName":"Jackman",
 "BirthDate":"1968-10-12T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Scarlett",
 "LastName":"Scarlett",
 "BirthDate":"1984-11-22T00:00:00.000+01:00",
 "emp_trigger":0
 }
 ],
 "Oscar":false,
 "Rating":8.5,
 "Premiere":[
 {
 "Country":"Italy",
 "Cinema":"Cineplexx",
 "PremiereDate":"2006-10-17T00:00:00.000+02:00",
 "emp_trigger":0
 },
 {
 "Country":"Austria",
 "Cinema":"Cineplexx",
 "PremiereDate":"2007-01-05T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "Country":"Denmark",
 "Cinema":"CineDK",
 "PremiereDate":"2007-01-05T00:00:00.000+01:00",
 "emp_trigger":0
 }
 ],
 "emp_trigger":0
 },
 {
 "Title":"Lucky Number Slevin",
 "ReleaseDate":"2006-02-24T00:00:00.000+01:00",
 "Actors":[
 {
 "FirstName":"Josh",
 "LastName":"Hartnett",
 "BirthDate":"1978-07-21T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Ben",
 "LastName":"Kingsley",
 "BirthDate":"1943-12-31T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Morgan",
 "LastName":"Freeman",
 "BirthDate":"1937-06-01T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "FirstName":"Bruce",
 "LastName":"Willis",
 "BirthDate":"1955-03-19T00:00:00.000+01:00",
 "emp_trigger":0
 }
 ],
 "Oscar":false,
 "Rating":7.8,
 "Premiere":[
 {
 "Country":"United Kingdom",
 "Cinema":"Cineplexx",
 "PremiereDate":"2006-02-24T00:00:00.000+01:00",
 "emp_trigger":0
 },
 {
 "Country":"Spain",
 "Cinema":"Cineplexx",
 "PremiereDate":"2006-03-30T00:00:00.000+02:00",
 "emp_trigger":0
 },
 {
 "Country":"Canada",
 "Cinema":"Cine",
 "PremiereDate":"2006-04-07T00:00:00.000+02:00",
 "emp_trigger":0
 },
 {
 "Country":"Columbia",
 "Cinema":"CineC",
 "PremiereDate":"2006-09-10T00:00:00.000+02:00",
 "emp_trigger":0
 }
 ],
 "emp_trigger":0
 }
 ],
 "emp_trigger":0
 },
 "field_name":"Movies",
 "field_type":"Relational"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"Profile not found."
}

Add To OTM Document

Inserts entire OTM document or saves partial One-To-Many data for specific Profile.

POST

/Profiles/AddToOTMDocument/

Parameters:
  • Integer
    profileid



    Profile ID whose data requires updating.
  • Integer
    fieldid



    Data field ID you are saving.
  • Array
    field_value



    The values you want to add into the OTM field.
  • String
    path



    The path where you want to insert new data.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Profiles/AddToOTMDocument' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"profileid":1097,"fieldid":17,"field_value":[{"Title":"John Wick: Chapter 3 - Parabellum","ReleaseDate":"17.05.2019","Actors":[{"FirstName":"Keanu","LastName":"Reeves","BirthDate":"02.09.1964"},{"FirstName":"Halle","LastName":"14.08.1966"}],"Oscar":false,"Rating":7.5,"Premiere":[{"Country":"Macedonia","Cinema":"Cineplexx","PremiereDate":"15.05.2019"}]}],"path":""}'
{
 "profileid": 1097,
 "fieldid": 17,
 "field_value": [{
	"Title": "John Wick: Chapter 3 - Parabellum",
	"ReleaseDate": "17.05.2019",
	"Actors": [{
		"FirstName": "Keanu",
		"LastName": "Reeves",
		"BirthDate": "02.09.1964"
	}, {
		"FirstName": "Halle",
		"LastName": "Colman",
		"Oscars": [{
			"Year": 2015,
			"AwardedFor": "Best Performance",
		}]
	}],
	"Oscar": false,
	"Rating": 7.5,
	"Premiere": [{
		"Country": "Macedonia",
		"Cinema": "Cineplexx",
		"PremiereDate": "15.05.2019"
	}]
 }],
 "path": ""
}
{
 "profileid": 1097,
 "fieldid": 17,
 "field_value": [{
	[{
		"FirstName": "Keanu",
		"LastName": "Reeves",
		"BirthDate": "02.09.1964"
	}]
 }],
 "path": "Actors"
}
{
 "profileid": 1097,
 "fieldid": 17,
 "field_value": [{
	[{
		"Year": 2015,
		"AwardedFor": "Best Performance",
	}]
 }],
 "path": "Actors.Oscars"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;
$fieldValue = array (
 array (
 "Title" => "John Wick: Chapter 3 - Parabellum",
 "ReleaseDate" => "17.05.2019",
 "Actors" => array (
 array (
 "FirstName" => "Keanu",
 "LastName" => "Reeves",
 "BirthDate" => "02.09.1964"
 ),
 array (
 "FirstName" => "Halle",
 "LastName" => "Berry",
 "LastName" => "14.08.1966"
 )
 ),
 "Oscar" => false,
 "Rating" => 7.5,
 "Premiere" => array (
 array (
 "Country" => "Macedonia",
 "Cinema" => "Cineplexx",
 "PremiereDate" => "15.05.2019"
 )
 )
 )
);

$path = "";

$result = $parser->AddToOTMDocument($profileid, $fieldid, $fieldValue, $path);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;

$search = array (
	"connector" => "and",
	"values" => array (
		array (
			"subitem" => "Title",
			"value" => 'John Wick: Chapter 3 - Parabellum',
			"operator" => "=",
			"type" => "text"
		)
	)
);

$fieldValue = array (
 "FirstName" => "Ian",
 "LastName" => "McShane",
 "BirthDate" => "29.09.1942"
);

$path = "Actors";

$result = $parser->AddToOTMDocument($profileid, $fieldid, $fieldValue, $path, $search);

print_r($result);	
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


Add entire document

int profileid = 1097;
int fieldid = 17;

Dictionary<string, object> movie = new Dictionary<string, object>();

List<Dictionary<string, object>> actors = new List<Dictionary<string, object>>();

List<Dictionary<string, object>> premieres = new List<Dictionary<string, object>>();

Dictionary actor1 = new Dictionary();
actor1.Add("FirstName", "Keanu");
actor1.Add("LastName", "Reeves");
actor1.Add("BirthDate", "02.09.1964");

Dictionary actor2 = new Dictionary();
actor2.Add("FirstName", "Halle");
actor2.Add("LastName", "Berry");
actor2.Add("BirthDate", "14.08.1966");

actors.Add(actor1);
actors.Add(actor2);
Dictionary premiere = new Dictionary();
premiere.Add("Country", "Macedonia");
premiere.Add("Cinema", "Cineplexx");
premiere.Add("PremiereDate", "15.05.2019");

premieres.Add(premiere);

movie.Add("Title", "John Wick: Chapter 3 - Parabellum");
movie.Add("ReleaseDate", "17.05.2019");
movie.Add("Actors", actors);
movie.Add("Oscar", false);
movie.Add("Rating", 7.5);
movie.Add("Premiere", premieres);

string path = "";

string result = parser.AddToOTMDocument(profileid, fieldid, movie, path);
using MarketingPlatform;


int profileid = 1097;
int fieldid = 17;

Dictionary<string, object> search = new Dictionary<string, object>();
List<Dictionary<string, object>> searchValues = new List<Dictionary<string, object>>();
Dictionary<string, object> searchValue = new Dictionary<string, object>();

search.Add("connector", "and");

searchValue.Add("subitem", "Title");
searchValue.Add("value", "John Wick: Chapter 3 - Parabellum");
searchValue.Add("operator", "=");
searchValue.Add("type", "text");

Dictionary<string, object> actor = new Dictionary<string, object>();
actor.Add("FirstName", "Ian");
actor.Add("LastName", "McShane");
actor.Add("BirthDate", "29.09.1942");

string path = "Actors";
search.Add("values", searchValues);

string result = parser.AddToOTMDocument(profileid, fieldid, actor, path, search);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"You have successfully added One-To-Many field"
}

{
 "status":false,
 "code":409,
 "message":"Can not add more than one object."
}

Update OTM Document

Update One-To-Many data for specific Profile.

PUT

/Profiles/UpdateOTMDocument/

Parameters:
  • Integer
    profileid



    Profile ID whose data requires updating.
  • Integer
    fieldid



    Data field ID you are saving.
  • Mixed
    replace



    The values you want to update on the OTM field.
  • String
    path



    The path where you want to update data.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Profiles/UpdateOTMDocument'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"profileid":1097,"fieldid":17,"search":[{"connector":"and","values":[{"subitem":"Title","value":"John Wick: Chapter 2","operator":"=","type":"text"}]}],"replace":[{"subitem":"Title","value":"John Wick 2","type":"text"},{"subitem":"ReleaseDate","value":"30.01.2018","type":"text"}],"path":""}'
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
	"connector": "and",
	"values": [{
		"subitem": "Title",
		"value": "John Wick: Chapter 2",
		"operator": "=",
		"type": "text"
	}]
 }],
 "replace": [{
	"subitem": "Title",
	"value": "John Wick 2",
	"type": "text"
 }, {
	"subitem": "ReleaseDate",
	"value": "30.01.2018",
	"type": "text"
 }],
 "path": ""
}
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
	"connector": "and",
	"values": [{
		"subitem": "FirstName",
		"value": "Keannu",
		"operator": "=",
		"type": "text"
	}]
 }],
 "replace": [{
	"subitem": "FirstName",
	"value": "Kalle",
	"type": "text"
 }]"
 }],
 "path": "Actors"
}
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
	"connector": "and",
	"values": [{
		"subitem": "Year",
		"value": 2012,
		"operator": "=",
		"type": "number"
	}]
 }],
 "replace": [{
	"subitem": "Year",
	"value": 2013,
	"type": "number"
 }]"
 }],
 "path": "Actors.Oscars"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;

$search = array (
	"connector" => "and",
	"values" => array (
		array (
			"subitem" => "Title",
			"value" => "John Wick: Chapter 2",
			"operator" => "=",
			"type" => "text"
		)
	)
);

$replace = array (
	array (
		"subitem" => "Title",
		"value" => "John Wick 2",
		"type" => "text"
	),
	array (
		"subitem" => "ReleaseDate",
		"value" => "30.01.2018",
		"type" => "text"
	)
);

$path = "";

$result = $parser->UpdateOTMDocument($profileid, $fieldid, $search, $replace, $path);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;

$search = array (
	"connector" => "and", //connector can be "OR" if you whant to match Any of the search values before UPDATE
	"values" => array (
		array (
				"subitem" => "FirstName",
				"value" => 'Ian',
				"operator" => "=",
				"type" => "text"
		),
		array (
				"subitem" => "LastName",
				"value" => 'McShane',
				"operator" => "=",
				"type" => "text"
		)
	)
);

$replace = array (
	array (
		"subitem" => "BirthDate",
		"value" => '29.09.1942',
		"type" => "date"
	)
);

$path = "Actors";

$result = $parser->UpdateOTMDocument($profileid, $fieldid, $search, $replace, $path);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


Update Title and ReleaseDate on 2nd Movie

int profileid = 1097;
int fieldid = 17;

List<Dictionary<string, object>> searchValues = new List<Dictionary<string, object>>();
List<Dictionary<string, object>> replace = new List<Dictionary<string, object>>();

Dictionary<string, object> search = new Dictionary<string, object>();
Dictionary<string, object> searchValue = new Dictionary<string, object>();
Dictionary<string, object> replaceValue = new Dictionary<string, object>();
Dictionary<string, object> replaceValue2 = new Dictionary<string, object>();

search.Add("connector", "and");

searchValue.Add("subitem", "Title");
searchValue.Add("value", "John Wick: Chapter 2");
searchValue.Add("operator", "=");
searchValue.Add("type", "text");

searchValues.Add(searchValue);
search.Add("values", searchValues);

replaceValue.Add("subitem", "Title");
replaceValue.Add("value", "John Wick 2");
replaceValue.Add("type", "text");

replaceValue2.Add("subitem", "ReleaseDate");
replaceValue2.Add("value", "20.08.2018");
replaceValue2.Add("type", "date");

replace.Add(replaceValue);
replace.Add(replaceValue2);

string path = "";

string result = parser.UpdateOTMDocument(profileid, fieldid, search, replace, path);


using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

$profileid = 1097;
$fieldid = 17;


List<Dictionary<string, object>> searchValues = new List<Dictionary<string, object>>();
List<Dictionary<string, object>> replace = new List<Dictionary<string, object>>();

Dictionary<string, object> search = new Dictionary<string, object>();
Dictionary<string, object> searchValue = new Dictionary<string, object>();
Dictionary<string, object> replaceValue = new Dictionary<string, object>();

search.Add("connector", "and");

searchValue.Add("subitem", "FirstName");
searchValue.Add("value", "Ian");
searchValue.Add("operator", "=");
searchValue.Add("type", "text");

searchValues.Add(searchValue);
search.Add("values", searchValues);

replaceValue.Add("subitem", "LastName");
replaceValue.Add("value", "Wick");
replaceValue.Add("type", "text");

replace.Add(replaceValue);

string path = "Actors"

string result = parser.UpdateOTMDocument(profileid, fieldid, search, replace, path);

Sample Response


{
 "status": true,
 "code": 201,
 "data": {
 "message":"You have successfully updated One-To-Many field"
 }
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Remove OTM Document

Remove One-To-Many data for specific Profile.

DELETE

/Profiles/RemoveOTMDocument/

Parameters:
  • Integer
    profileid



    Profile ID whose data have to be deleted.
  • Integer
    fieldid



    Data Field ID that you want to delete.
  • String
    path



    The path where you want to update data.
  • Integer
    index



    Which element to delete.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE  'https://api.mailmailmail.net/v2.0/Profiles/RemoveOTMDocument'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"profileid":1097,"fieldid":17,"search":[{"connector":"and","values":[{"subitem":"Title","value":"John Wick: Chapter 3 - Parabellum","operator":"=","type":"text"}]}],"path":""}'
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
 "connector": "and",
 "values": [{
 "subitem": "Title",
 "value": "John Wick: Chapter 3 - Parabellum",
 "operator": "=",
 "type": "text"
 }]
 }],
 "path": ""
}
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
 "connector": "and",
 "values": [{
 "subitem": "FirstName",
 "value": "Keannu",
 "operator": "=",
 "type": "text"
 }]
 }],
 "path": "Actors"
}
{
 "profileid": 1097,
 "fieldid": 17,
 "search": [{
 "connector": "and",
 "values": [{
 "subitem": "Year",
 "value": 2013,
 "operator": "=",
 "type": "number"
 }]
 }],
 "path": "Actors.Oscars"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;
$path = "";

$search = array (
	"connector" => "and",
	"values" => array (
		array (
			"subitem" => "Title",
			"value" => 'John Wick: Chapter 3 - Parabellum',
			"operator" => "=",
			"type" => "text"
		)
	)
);

$result = $parser->RemoveOTMDocument($profileid, $fieldid, $search, $path);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$fieldid = 17;
$path = "Actors";

$search = array (
	"connector" => "and",
	"values" => array (
		array (
			"subitem" => "FirstName",
			"value" => 'Keanu',
			"operator" => "=",
			"type" => "text"
		)
	)
);

$result = $parser->RemoveOTMDocument($profileid, $fieldid, $search, $path);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


Remove 2nd Movie

int profileid = 1097;
int fieldid = 17;

List<Dictionary<string, object>> searchValues = new List<Dictionary<string, object>>();

Dictionary<string, object> search = new Dictionary<string, object>();
Dictionary<string, object> searchValue = new Dictionary<string, object>();

search.Add("connector", "and");

searchValue.Add("subitem", "Title");
searchValue.Add("value", "John Wick: Chapter 3 - Parabellum");
searchValue.Add("operator", "=");
searchValue.Add("type", "text");

searchValues.Add(searchValue);
search.Add("values", searchValues);

string path = "";


string result = parser.RemoveOTMDocument(profileid, fieldid, search, path);

using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
int fieldid = 17;
string path = "Actors";

List<Dictionary<string, object>> searchValues = new List<Dictionary<string, object>>();

Dictionary<string, object> search = new Dictionary<string, object>();
Dictionary<string, object> searchValue = new Dictionary<string, object>();

search.Add("connector", "and");

searchValue.Add("subitem", "FirstName");
searchValue.Add("value", "Keanu");
searchValue.Add("operator", "=");
searchValue.Add("type", "text");

searchValues.Add(searchValue);
search.Add("values", searchValues);

string result = parser.RemoveOTMDocument(profileid, fieldid, search, path);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"You have successfully removed One-To-Many field"
}

{
 "status":false,
 "code":409,
 "message":"Can not delete OTM field"
}

Resubscribe Profile

Resubscribe Profile if the profile is deleted.

POST

/Profiles/ResubscribeProfile/

Parameters:
  • String
    email_address



    Email address of the profile.
  • String
    mobile_number



    Mobile number of the profile.
  • String
    mobile_prefix



    Country dialing code.
  • Boolean
    add_to_autoresponders



    Whether or not to add the Profile to the List Autoresponders.
Response:
  • On success:
    HTTP code 200



    JSON object with the result for each list.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST  'https://api.mailmailmail.net/v2.0/Profiles/ResubscribeProfile' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"email_address":"contact@marketingplatform.com","mobile_number":"72444444","mobile_prefix":"45","add_to_autoresponders":false}'
{
 "email_address": "contact@marketingplatform.com",
 "mobile_number": "72444444",
 "mobile_prefix": "45",
 "add_to_autoresponders": false
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$emailaddress = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";
$addToAutoreposnders = false;

$result = $parser->ResubscribeProfile($emailaddress, $mobileNumber, $mobilePrefix, $addToAutoreposnders);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string emailaddress = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";
bool addToAutoresponders = false;
string result = parser.ResubscribeProfile(emailaddress, mobileNumber, mobilePrefix, addToAutoreposnders);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "listid":2,
 "result":"Profile has been successfully resubscribed.",
 "profileid":1179
 },
 {
 "listid":3,
 "result":"Profile has been successfully resubscribed.",
 "profileid":1180
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Request Update Email

Request to change current email address.

PUT

/Profiles/RequestUpdateEmail/

Parameters:
  • Integer
    profileid



    Which profile to update.
  • String
    old_email



    Current email address.
  • String
    new_email



    New email address.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT  'https://api.mailmailmail.net/v2.0/Profiles/RequestUpdateEmail' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"profileid":1092,"old_email":"contact@marketingplatform.com","new_email":"info@marketingplatform.com"}'
{
 "profileid": 1092,
 "old_email": "contact@marketingplatform.com",
 "new_email": "info@marketingplatform.com"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1092;
$oldEmail = "contact@marketingplatform.com";
$newEmail = "info@marketingplatform.com";

$result = $parser->RequestUpdateEmail($profileid, $oldEmail, $newEmail);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1092;
string oldEmail = "contact@marketingplatform.com";
string newEmail = "info@marketingplatform.com";

string result = parser.RequestUpdateEmail(profileid, oldEmail, newEmail);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"You have successfully made update request"
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Update Email

BETA

Change current email address without sending confirmation email.

A confirmation formis required for every list that needs to be updated, as the recovery page is part of the confirmation form and cannot function without it.

When using a mobile number as the reference ID for identifying and updating profiles, the number must begin with either “+” or “00” to ensure proper format recognition and matching.

When a profile update is performed using a mobile number, and the associated profile has an email address configured for recovery, a recovery email will automatically be sent to that email address.

PUT

/Profiles/emailaddres

The reference can be one of the following:
profileid – updates a single profile
emailaddress – updates all profiles with that email
mobile – updates all profiles with that mobile number
Parameters:
  • Multitype
    Reference



    Which profile/s to updated.
  • String
    new_email



    New email address.
Response:
  • On success:
    HTTP code 200



    Provides a JSON response listing updated and failed emails.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT  'https://api.mailmailmail.net/v2.0/Profiles/emailaddress' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{
 "reference":"8237",
 "new_email":"info@marketingplatform.com"
 }'

{
 "reference": 1092,
 "new_email": "info@marketingplatform.com"
} 


{
 "reference": "+45283848", // || 0045283848
 "new_email": "info@marketingplatform.com"
} 


{
 "reference": "exmple@gmail.com",
 "new_email": "info@marketingplatform.com"
} 

Sample Response



{
"status": true,
"code": 200,
"Response_Info": {
 "New emailaddress is duplicate on list(s).": [
 "255",
 "257",
 "258",
 "256",
 "260",
 "259",
 "248",
 "250",
 "267"
 ],
 "Unconfiermed emailaddress on list(s).": {
 "261": "8210",
 "262": "8213"
 },
 "Bounce emailaddress on list(s).": {
 "263": "8211"
 },
 "Disabled emailaddress on list(s).": {
 "264": "8212"
 },
 "Emailaddres updated on list(s).": {
 "266": "8214",
 "265": "8215"
 }
}
}


{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Change Mobile

Change mobile of a profile.

PUT

/Profiles/ChangeMobile/

Parameters:
  • Integer
    profileid



    Which profile to update.
  • Integer
    mobile_number



    Mobile number.
  • Integer
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Profiles/ChangeMobile' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"profileid":1097,"mobile_number":"72444444","mobile_prefix":"45"}'
{
 "profileid": 1097,
 "mobile_number": "72444444",
 "mobile_prefix": "45"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 1097;
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->ChangeMobile($profileid, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
string mobileNumber = "72444444";
string mobilePrefix = "44";

string result = parser.ChangeMobile(profileid, mobileNumber, mobilePrefix);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"Mobile Number has been changed"
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Is Profile On List

Checks whether a Profile is on a particular List based on their Email Address or profile ID.

GET

/Profiles/IsProfileOnList/

Parameters:
  • Integer
    listid



    List ID to check.
  • String
    email_address



    Email address to check.
  • String
    mobile_number



    Mobile phone to check.
  • String
    mobile_prefix



    Country dialing code.
  • Integer
    profileid



    Profile ID. This can be used instead of the email address.
Response:
  • On success:
    HTTP code 200



    Json object with profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/IsProfileOnList?listid=10&email_address=contact@marketingplatform.com&mobile_number=72444444&mobile_prefix=45&profileid=51'-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);

$listid = 10;
$emailaddress = "contact@marketingplatform.com";
$mobileNumber = "72444444";
$mobilePrefix = "45";
$profileid = 51;

$result = $parser->IsProfileOnList($listid, $emailaddress, $mobileNumber, $mobilePrefix, $profileid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
string emailaddress = "contact@marketingplatform.com";
string mobileNumber = "72444444";
string mobilePrefix = "45";
int profileid = 51;

string result = parser.IsProfileOnList(listid, emailaddress, mobileNumber, mobilePrefix, profileid);

Sample Response


{
 "status": true,
 "code": 200,
 "profileid":51
}

{
 "status":false,
 "code":200,
 "message":"Subscriber is not on the list"
}

Is Unsubscriber Email

Checks whether an email address is an 'unsubscriber'.

GET

/Profiles/IsUnsubscriberEmail/

Parameters:
  • Integer
    listid



    List ID to check.
  • String
    email_address



    Email address to check.
Response:
  • On success:
    HTTP code 200



    Json object with profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/IsUnsubscriberEmail?listid=10&email_address=contact@marketingplatform.com'-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);

$listid = 10;
$emailaddress = "contact@marketingplatform.com";

$result = $parser->IsUnsubscriberEmail($listid, $emailaddress);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
string emailaddress = "contact@marketingplatform.com";

string result = parser.IsUnsubscriberEmail(listid, emailaddress);

Sample Response


{
 "status": true,
 "code": 202,
 "profileid":466
}

{
 "status":false,
 "code":202,
 "message":"This user is not owner of the list"
}

Is Unsubscriber Mobile

Checks whether an email address is an 'unsubscriber'.

GET

/Profiles/IsUnsubscriberMobile/

Parameters:
  • Integer
    listid



    List ID to check.
  • String
    mobile_number



    Mobile phone to check for.
  • String
    mobile_prefix



    Country dialing code.
  • Integer
    profileid



    Profile ID. This can be used instead of the mobile.
Response:
  • On success:
    HTTP code 200



    Json object with profile ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/IsUnsubscriberMobile?listid=10&mobile_number=72444444&mobile_prefix=45'-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);

$listid = 10;
$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->IsUnsubscriberEmail($listid, $mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.IsUnsubscriberMobile(listid, mobileNumber, mobilePrefix);

Sample Response


{
 "status": true,
 "code": 202,
 "profileid":1182
}

{
 "status":false,
 "code":202,
 "message":"This user is not owner of the list"
}

Unsubscribe Profile by Email

Unsubscribes an Email Address from a specific List.

POST

/Profiles/UnsubscribeProfileEmail/

Parameters:
  • Integer
    listid



    List ID to check.
  • String
    email_address



    Profile Email Address to be unsubscribed.
  • Integer
    profileid



    Profile ID to unsubscribed.
  • Integer
    statid



    The statistics ID that has to be updated.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Profiles/UnsubscribeProfileEmail'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"listid":10,"email_address":"contact@marketingplatform.com","profileid":26,"statid":3}'
{
 "listid": 10,
 "email_address": "contact@marketingplatform.com",
 "profileid": 26,
 "statid": 3
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 10;
$emailaddress = "contact@marketingplatform.com";
$profileid = 26;
$statid = 3;

$result = $parser->UnsubscribeProfileEmail($listid, $emailaddress, $profileid, $statid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
string emailaddress = "contact@marketingplatform.com";
int profileid = 26;
int statid = 3;

string result = parser.UnsubscribeProfileEmail(listid, emailaddress, profileid, statid);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"The profile has been successfully unsubscribed"
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Unsubscribe Profile by Mobile

Unsubscribes a mobile from a specific List.

POST

/Profiles/UnsubscribeProfileMobile/

Parameters:
  • Integer
    listid



    List from which to remove the Profile.
  • String
    mobile_number



    Profile’s mobile to be unsubscribed.
  • String
    mobile_prefix



    Country dialing code.
  • Integer
    profileid



    Profile ID to be unsubscribed. This can be used instead of the mobile.
  • Integer
    statid



    The statistics ID that has to be updated.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Profiles/UnsubscribeProfileMobile'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"listid":10,"mobile_number":"72444444","mobile_prefix":"45","profileid":26,"statid":3}'
{
 "listid": 10,
 "mobile_number": "72444444",
 "mobile_prefix": "45",
 "profileid": 26,
 "statid": 3
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 10;
$mobileNumber = "72444444";
$mobilePrefix = "45";
$profileid = 26;
$statid = 3;

$result = $parser->UnsubscribeProfileMobile($listid, $mobileNumber, $mobilePrefix, $profileid, $statid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
string mobileNumber = "72444444";
string mobilePrefix = "45";
int profileid = 26;
int statid = 3;

string result = parser.UnsubscribeProfileMobile(listid, mobileNumber, mobilePrefix, profileid, statid);

Sample Response


{
 "status": true,
 "code": 200,
 "message":"The profile has been successfully unsubscribed"
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Get All Profiles

Get all profiles.

GET

/Profiles

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetAllProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
		
bool countOnly = false;
int limit = 2;
int offset = 0;
 
string result = parser.GetAllProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 },
 {
 "profileid":5,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542987065,
 "confirm_date":1542987065,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector - FTP OTM data"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get All Profiles

Get all profiles.

GET

/Profiles/GetAllProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetAllProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetAllProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
		
bool countOnly = false;
int limit = 2;
int offset = 0;
 
string result = parser.GetAllProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 },
 {
 "profileid":5,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542987065,
 "confirm_date":1542987065,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector - FTP OTM data"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Active Profiles

Get only active profiles.

GET

/Profiles/GetActiveProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetActiveProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetActiveProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

bool countOnly = false;
int limit = 2;
int offset = 0
 
string result = parser.GetActiveProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "API - test_api_key"
 },
 {
 "profileid":10,
 "listid":4,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1544429993,
 "confirm_date":1544429993,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profiles By List

Get a list of profiles for the specific list.

GET

/Profiles/GetProfilesByList/

Parameters:
  • Integer
    listid



    List ID.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByList?listid=24&count_only=false&limit=1&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);

$listid = 24;
$countOnly = false;
$limit = 1;
$offset = 0;

$result = $parser->GetProfilesByList($listid, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 24;
bool countOnly = false;
int limit = 1;
int offset = 0;

string result = parser.GetProfilesByList(listid, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid": 68268,
 "listid": 24,
 "email_address": "support@marketingplatform.com",
 "mobile": "78546072",
 "mobile_prefix": "45",
 "subscribe_date": 1617282743,
 "confirm_date": 1617283743,
 "unsubscribed": 0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating": 1,
 "leadscore": 0,
 "sign_up_source" "Connector"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list."
}

Get Profiles By Link Click

Get a list of profiles based on a link click.

GET

/Profiles/GetProfilesByLinkClick/

Parameters:
  • Integer
    linkid



    Link ID.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByLinkClick?linkid=24&count_only=false&limit=1&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);

$linkid = 24;
$countOnly = false;
$limit = 1;
$offset = 0;

$result = $parser->GetProfilesByLinkClick($linkid, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int linkid = 24;
bool countOnly = false;
int limit = 1;
int offset = 0;

string result = parser.GetProfilesByLinkClick(linkid, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1097,
 "listid":24,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":null,
 "subscribe_date": 1617272743,
 "confirm_date": 1617283543,
 "unsubscribed": 0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating": 1,
 "leadscore": 0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list."
}

Get Profiles By Autoresponder

Get a list of profiles from autoresponder.

GET

/Profiles/GetProfilesByAutoresponder/

Parameters:
  • Integer
    autoresponderid



    Autoresponder ID.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByAutoresponder?autoresponderid=24&count_only=false&limit=1&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);

$autoresponderid = 24;
$countOnly = false;
$limit = 1;
$offset = 0;

$result = $parser->GetProfilesByAutoresponder($autoresponderid, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int autoresponderid = 24;
bool countOnly = false;
int limit = 1;
int offset = 0;

string result = parser.GetProfilesByAutoresponder(autoresponderid, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1096,
 "listid":24,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1575032494,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list."
}

Get Profiles By Newsletter

Get a list of profiles who are receiving a newsletter.

GET

/Profiles/GetProfilesByNewsletter/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
  • String
    type



    Type of newsletter [ sent / open / notopen ].
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByNewsletter?newsletterid=24&type=open&count_only=false&limit=2&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);

$newsletterid = 24;
$type = "open"; // Availbale options: "sent", "open", "notopen"
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesByNewsletter($newsletterid, $type, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 24;
string type = "open"; // Availbale options: "sent", "open", "notopen"
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesByNewsletter(newsletterid, type, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":52,
 "listid":7,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1552312263,
 "confirm_date":1552312263,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":51,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1552312263,
 "confirm_date":1552312263,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list."
}

Get Profiles From Segment

Get a list of profiles from the segment.

GET

/Profiles/GetProfilesFromSegment/

Parameters:
  • Integer
    segmentid



    Segment ID.
  • Boolean
    count_only



    Whether to do a count only, or to get the List of Profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesFromSegment?segmentid=24&count_only=false&limit=2&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);

$segmentid = 24;
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesFromSegment($segmentid, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 24;
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesFromSegment(segmentid, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":52,
 "listid":7,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1552312263,
 "confirm_date":1552312263,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Flow"
 },
 {
 "profileid":51,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1552312263,
 "confirm_date":1552312263,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled": 0,
 "bounced": 0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list."
}

Get Profiles By Email

Get a list of profiles based on their email address.

GET

/Profiles/GetProfilesByEmail/

Parameters:
  • String
    email_address



    Email address.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByEmail?email_address=contact@marketingplatform.com&count_only=false&limit=2&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);

$emailaddress = "contact@marketingplatform.com";
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesByEmail($emailaddress, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string emailaddress = "contact@marketingplatform.com";
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesByEmail(emailaddress, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":10,
 "listid":4,
 "email_address":"contact@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1544429993,
 "confirm_date":1544429993,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Flow"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By Mobile

Get a list of profiles based on their mobile number.

GET

/Profiles/GetProfilesByMobile/

Parameters:
  • String
    mobile_number



    Mobile number.
  • String
    mobile_prefix



    Country dialing code.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByMobile?mobile_number=72444444&mobile_prefix=45&count_only=false&limit=2&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);

$mobileNumber = "72444444";
$mobilePrefix = "45"
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesByMobile($mobileNumber, $mobilePrefix, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = "API_USERNAME";
string token = "API_TOKEN";


ApiParser parser = new ApiParser(username, token);

string mobileNumber = "72444444";
string mobilePrefix = "45";
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesByMobile(mobileNumber, mobilePrefix, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":10,
 "listid":4,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1544429993,
 "confirm_date":1544429993,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Zapier"
 },
 {
 "profileid":1065,
 "listid":11,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1565686709,
 "confirm_date":1565686709,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By Domain

Get a list of profiles based on their domain.

GET

/Profiles/GetProfilesByDomain/

Parameters:
  • String
    domain



    Domain name
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByDomain?domain=@marketingplatform.com&count_only=false&limit=2&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);

$domain = "@marketingplatform.com";
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesByDomain($domain, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string domain = "@marketingplatform.com";
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesByDomain(domain, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Facebook Lead Ads"
 },
 {
 "profileid":10,
 "listid":4,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1544429993,
 "confirm_date":1544429993,
 "unsubscribed":0,
 "sms_unsubscribed":0
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Unsubscribed Profiles

Get only unsubscribed profiles.

GET

/Profiles/GetUnsubscribedProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetUnsubscribedProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetUnsubscribedProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetUnsubscribedProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":41,
 "listid":5,
 "email_address":"support@marketingplatform.com",
 "mobile":"7244444",
 "mobile_prefix":"45",
 "subscribe_date":0,
 "confirm_date":1571319782,
 "unsubscribed":1571658612,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":58,
 "listid":9,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1559636468,
 "confirm_date":1559636468,
 "unsubscribed":1562330373,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Unconfirmed Profiles

Get only unconfirmed profiles.

GET

/Profiles/GetUnconfirmedProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetUnconfirmedProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetUnconfirmedProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetUnconfirmedProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":36,
 "listid":6,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1615456426,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":37,
 "listid":5,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":1615456426,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Not defined"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Disabled Profiles

Get only disabled profiles.

GET

/Profiles/GetDisabledProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetDisabledProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetDisabledProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetDisabledProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":7,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542987158,
 "confirm_date":1542987158,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":1576660161,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":46,
 "listid":3,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":0,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":1576660173,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Bounced Profiles

Get only bounced profiles.

GET

/Profiles/GetBouncedProfiles/

Parameters:
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetBouncedProfiles?count_only=false&limit=2&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);

$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetBouncedProfiles($countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetBouncedProfiles(countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":37,
 "listid":5,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":0,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":1552722654,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector"
 },
 {
 "profileid":56,
 "listid":5,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1559118807,
 "confirm_date":1576660202,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":1576660202,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By SMS Status

Get a list of profiles based on their sms status.

GET

/Profiles/GetProfilesBySMSStatus/

Parameters:
  • Boolean
    active



    SMS status. [Default is true]
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesBySMSStatus?active=true&count_only=false&limit=2&offset=2' -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);

$active = true;
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesBySMSStatus($active, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


bool active = true;
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesBySMSStatus(active, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":41,
 "listid":5,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"44",
 "subscribe_date":0,
 "confirm_date":1571319782,
 "unsubscribed":1571658612,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 },
 {
 "profileid":42,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "subscribe_date":0,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By Rating

Get a list of profiles based on mail rating.

GET

/Profiles/GetProfilesByRating/

Parameters:
  • String
    rating



    Profiler’s mail rating [ vip / good / average / poor ]
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByRating?rating=vip&count_only=false&limit=2&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);

$rating = "vip"; // Available ratings: "poor", "average", "good", "vip"
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesByRating($rating, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string rating = "vip"; // Available ratings: "poor", "average", "good", "vip"
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesByRating(rating, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":2,
 "listid":2,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542796778,
 "confirm_date":1542796778,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":14,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":5,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1542987065,
 "confirm_date":1542987065,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "disabled":0,
 "bounced":0,
 "rating":14,
 "leadscore":0,
 "sign_up_source" "Import"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By Date

Get a list of profiles by date.

GET

/Profiles/GetProfilesByDate/

Parameters:
  • Timestamp
    start_date



    Starting date.
  • Timestamp
    end_date



    End date [ after / before / exactly / between / not ].
  • String
    type



    Search type.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET  'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByDate?start_date=1592929276&end_date=false&type=after&count_only=false&limit=1&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);

$startDate = 1592929276;
$endDate = false;
$type = "after"; /* Available options: "after","before","exactly",
"between","not" */
$countOnly = false;
$limit = 1;
$offset = 0;
		 
$result = $parser->GetProfilesByDate($startDate, $endDate, $type, $countOnly, $limit, $offset);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$startDate = 1592929276;
$endDate = 1593015676; 
$type = "between"; /* Available options: "after","before","exactly",
"between","not" */
$countOnly = true;
		
$result = $parser->GetProfilesByDate($startDate, $endDate, $type, $countOnly);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

long startDate = 1592929276;
bool endDate = false;
string type = "after"; /* Available options: "after","before","exactly","between","not" */
bool countOnly = false;
int limit = 1;
int offset = 0;
		 
string result = parser.GetProfilesByDate(startDate, endDate, type, countOnly, limit, offset);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

long startDate = 1592929276;
long endDate = 1593015676;
string type = "after"; /* Available options: "after","before","exactly","between","not" */
bool countOnly = false;
int limit = 1;
int offset = 0;
		 
string result = parser.GetProfilesByDate(startDate, endDate, type, countOnly, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":462,
 "listid":209,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "subscribe_date":1592912033,
 "confirm_date":0,
 "unsubscribed":0,
 "sms_unsubscribed":0,
 "bounced":0,
 "disabled":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector - FTP OTM data"
 }
 ]
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Profiles By DataField

Get a List of Profiles information based on their data field.

GET

/Profiles/GetProfilesByDataField/

Parameters:
  • Integer
    listid



    List ID.
  • Integer
    fieldid



    data field ID.
  • String
    field_value



    Value of data field.
  • Boolean
    active_only



    Whether or not to check for active profiles.
  • Boolean
    count_only



    Whether to do a count only or to get the list of profiles.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesByDataField?listid=55&fieldid=8&field_value=Vejen&active_only=true&count_only=false&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);

$listid = 55;
$fieldid = 8; // Field ID for City.
$fieldValue = "Vejen"; // City name.
$activeOnly = true;
$countOnly = false;
$limit = 1;
$offset = 0;

$result = $parser->GetProfilesByDataField($listid, $fieldid, $fieldValue, $activeOnly, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 55;
int fieldid = 8; // Field ID for City.
string fieldValue = "Vejen"; // City name.
bool activeOnly = true;
bool countOnly = false;
int limit = 1;
int offset = 0;

string result = parser.GetProfilesByDataField(listid, fieldid, fieldValue);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":459,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "format":"h",
 "subscribe_date":1574083171,
 "confirmed":1,
 "unsubscribed":0,
 "bounced":0,
 "disabled":0,
 "rating":1,
 "listid":216,
 "sms_unsubscribed":0,
 "leadscore":0,
 "sign_up_source" "Connector - Flat data"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Sent Newsletter Events

Get profile events for sent newsletters.

GET

/Profiles/GetProfileSentNewsletterEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileSentNewsletterEvents?profileid=52&limit=2&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);

$profileid = 52;
$limit = 2;
$offset = 0;

$result = $parser->GetProfileSentNewsletterEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 52;
int limit = 2;
int offset = 0;

string result = parser.GetProfileSentNewsletterEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "eventid":14,
 "profileid":52,
 "event_type":"Sent an Email Campaign",
 "event_subject":"Sent the Email Campaign \"Campaign 1\"",
 "event_date":1568283901,
 "last_update":1552398901,
 "event_notes":""
 },
 {
 "eventid":13,
 "profileid":52,
 "event_type":"Sent an Email Campaign",
 "event_subject":"Sent the Email Campaign \"Campaign 1\"",
 "event_date":1552384761,
 "last_update":1552384761,
 "event_notes":""
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Open Newsletter Events

Get profile events for opened newsletters.

GET

/Profiles/GetProfileOpenNewsletterEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileOpenNewsletterEvents?profileid=50&limit=2&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);

$profileid = 50;
$limit = 2;
$offset = 0;

$result = $parser->GetProfileOpenNewsletterEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 50;
int limit = 2;
int offset = 0;

string result = parser.GetProfileOpenNewsletterEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":50,
 "event_type":"Opened an Email Campaign",
 "newsletterid":2,
 "event_date":1552398901,
 "statid":12
 },
 {
 "profileid":50,
 "event_type":"Opened an Email Campaign",
 "newsletterid":5,
 "event_date":1552399201,
 "statid":16
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Click Newsletter Events

Get profile events for clicked newsletters.

GET

/Profiles/GetProfileClickNewsletterEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileClickNewsletterEvents?profileid=1097&limit=2&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);

$profileid = 1097;
$limit = 2;
$offset = 0;

$result = $parser->GetProfileClickNewsletterEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
int limit = 2;
int offset = 0;

string result = parser.GetProfileClickNewsletterEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1097,
 "event_type":"Clicked a Link in an Email",
 "newsletterid":2,
 "event_date":1575477276,
 "statid":12
 },
 {
 "profileid":1097,
 "event_type":"Clicked a Link in an Email",
 "newsletterid":5,
 "event_date":1575477334,
 "statid":16
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Sent Trigger Events

Get profile events for sent triggers.

GET

/Profiles/GetProfileSentTriggerEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileSentTriggerEvents?profileid=244&limit=2&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);

$profileid = 244;
$limit = 2;
$offset = 0;

$result = $parser->GetProfileSentTriggerEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 244;
int limit = 2;
int offset = 0;

string result = parser.GetProfileSentTriggerEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "eventid":4179987,
 "profileid":244,
 "event_type":"Sent an Email Campaign",
 "event_subject":"Sent the Email Campaign \"Test OTM\"",
 "event_date":1542883467,
 "last_update":1542883467,
 "event_notes":"Sent from the trigger \"Test OTM \""
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Open Trigger Events

Get profile events for opened triggers.

GET

/Profiles/GetProfileOpenTriggerEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileOpenTriggerEvents?profileid=50&limit=2&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);

$profileid = 50;
$limit = 2;
$offset = 0;

$result = $parser->GetProfileOpenTriggerEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 50;
int limit = 2;
int offset = 0;

string result = parser.GetProfileOpenTriggerEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":50,
 "event_type":"Opened an Email Campaign",
 "newsletterid":2,
 "event_date":1552398901,
 "statid":9
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Click Trigger Events

Get profile events for clicked triggers.

GET

/Profiles/GetProfileClickTriggerEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileClickTriggerEvents?profileid=1097&limit=1&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);

$profileid = 1097;
$limit = 1;
$offset = 0;

$result = $parser->GetProfileClickTriggerEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
int limit = 1;
int offset = 0;

string result = parser.GetProfileClickTriggerEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1097,
 "eventtype":"Clicked a Link in an Email",
 "newsletterid":2,
 "eventdate":1575477276,
 "statid":9
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Sent Autoresponder Events

Get profile events for sent autoresponders.

GET

/Profiles/GetProfilesentAutoresponderEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileSentAutoresponderEvents?profileid=244&limit=1&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);

$profileid = 244;
$limit = 1;
$offset = 0;

$result = $parser->GetProfileSentAutoresponderEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 244;
int limit = 1;
int offset = 0;

string result = parser.GetProfileSentAutoresponderEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "eventid":4179903,
 "profileid":244,
 "event_type":"Sent an Autoresponder",
 "event_subject":"Sent the Autoresponder \"birthday 15 nov\"",
 "event_date":1542283444,
 "last_update":1542283444,
 "event_notes":""
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Open Autoresponder Events

Get profile events for opened autoresponders.

GET

/Profiles/GetProfileOpenAutoresponderEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileOpenAutoresponderEvents?profileid=50&limit=1&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);

$profileid = 50;
$limit = 1;
$offset = 0;

$result = $parser->GetProfileOpenAutoresponderEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 50;
int limit = 1;
int offset = 0;

string result = parser.GetProfileOpenAutoresponderEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":50,
 "event_type":"Opened an Email Campaign",
 "event_date":1552398901,
 "autoresponderid":1,
 "statid":14
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profile Click Autoresponder Events

Get profile events for clicked autoresponders.

GET

/Profiles/GetProfileClickAutoresponderEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileClickAutoresponderEvents?profileid=1097&limit=1&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);

$profileid = 1097;
$limit = 1;
$offset = 0;

$result = $parser->GetProfileClickAutoresponderEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 1097;
int limit = 1;
int offset = 0;

string result = parser.GetProfileClickAutoresponderEvents(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1097,
 "event_type":"Clicked a Link in an Email",
 "autoresponderid":1,
 "event_date":1575477276,
 "statid":14
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}
>

Get Profile Tracking Events

Get profile tracking events.

GET

/Profiles/GetProfileTrackingEvents/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with profile’s tracking events.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileTrackingEvents?profileid=46558244&limit=3&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);

$profileid = 46558244;
$limit = 3;
$offset = 0;

$result = $parser->GetProfileTrackingEvents($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
			
int profileid = 46558244;
int limit = 3;
int offset = 0;

string result = parser.GetProfileTrackingEvents(profileid, limit, offset);

Sample Response


 {
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":46558244,
 "action":"timespend",
 "request_url":"http:\/\/domain.com\/wordpress\/product\/baby-dresses\/",
 "product_url":"",
 "time":1565178417
 },
 {
 "profileid":46558244,
 "action":"pageview",
 "request_url":"http:\/\/domain.com\/wordpress\/product\/baby-dresses\/",
 "product_url":"",
 "time":1565178416
 },
 {
 "profileid":46558244,
 "action":"pageview",
 "request_url":"http:\/\/domain.com\/wordpress\/product\/baby-dresses\/",
 "product_url":"",
 "time":1565178416
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}
>

Get Profiles Updated DF

Get a List of Profiles updated data field.

GET

/Profiles/GetProfilesUpdatedDF/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    date



    Set from which date.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
  • String
    type



    Before will return profiles updated before given timestamp
    On will return profiles updated that day
    After will return profiles updated after given timestamp
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesUpdatedDF?listid=10&date=1565281276&limit=2&offset=0&type=on' -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);

$listid = 10;
$date = 1565281276;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesUpdatedDF($listid, $date, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
long date = 1565281276;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesUpdatedDF(listid, date, limit, offset);

Sample Response


 {
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":70,
 "listid":10,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":1,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Not defined"
 },
 {
 "profileid":78,
 "listid":10,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":1,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Manual"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}
>

Get Profiles Unsubscribed

Get a list of unsubscribed profiles.

GET

/Profiles/GetProfilesUnsubscribed/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    date



    Set from which date.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
  • String
    type



    Before will return profiles Unsubscribed before given timestamp
    On will return profiles Unsubscribed that day
    After will return profiles Unsubscribed after given timestamp
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesUnsubscribed?listid=11&date=1565281276&limit=2&offset=0&type=after' -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);

$listid = 11;
$date = 1565281276;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesUnsubscribed($listid, $date, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 10;
long date = 1565281276;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesUnsubscribed(listid, date, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1066,
 "listid":11,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":0,
 "unsubscribed":1559636468,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 },
 {
 "profileid":1068,
 "listid":11,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":0,
 "unsubscribed":1559636468,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Import"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profiles Confirmed

Get a list of confirmed profiles.

GET

/Profiles/GetProfilesConfirmed/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    date



    Set from which date.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
  • String
    type



    Before will return profiles Confirmed before given timestamp
    On will return profiles Confirmed that day
    After will return profiles Confirmed after given timestamp
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesConfirmed?listid=11&date=1565281276&limit=2&offset=0&type=before' -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);

$listid = 11;
$date = 1565281276;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesConfirmed($listid, $date, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 11;
long date = 1565281276;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesConfirmed(listid, date, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1065,
 "listid":11,
 "email_address":"support@marketingplatform.com",
 "mobile":"72444444",
 "mobile_prefix":"45",
 "confirmed":1559636468,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector"
 },
 {
 "profileid":1071,
 "listid":11,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":1559636468,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Connector"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profiles Disabled

Get a list of disabled profiles.

GET

/Profiles/GetProfilesDisabled/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    date



    Set from which date.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
  • String
    type



    Before will return profiles Disabled before given timestamp
    On will return profiles Disabled that day
    After will return profiles Disabled after given timestamp
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesDisabled?listid=3&date=1565281276&limit=2&offset=0&type=on' -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);

$listid = 3;
$date = 1565281276;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesDisabled($listid, $date, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string listid = 3;
long date = 1565281276;
int limit = 2;
int offset = 0;

string result = parser.GetProfilesDisabled(listid, date, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":46,
 "listid":3,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":0,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "API"
 },
 {
 "profileid":7,
 "listid":3,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":1,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "API"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Profiles SMS Unsubscribed

Get a list of sms unsubscribed profiles.

GET

/Profiles/GetProfilesSMSUnsubscribed/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    date



    Set from which date.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
  • String
    type



    Before will return profiles SMS Unsubscribed before given timestamp
    On will return profiles SMS Unsubscribed that day
    After will return profiles SMS Unsubscribed after given timestamp
Response:
  • On success:
    HTTP code 200



    Json object with profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfilesSMSUnsubscribed?listid=11&date=1565281276&limit=2&offset=0&type=on' -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);

$listid = 11;
$date = 1565281276;
$limit = 2;
$offset = 0;

$result = $parser->GetProfilesSMSUnsubscribed($listid, $date, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 11;
logn date = 1565281276;
int limit = 2;
int offset = 0;


string result = parser.GetProfilesSMSUnsubscribed(listid, date, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":1085,
 "listid":11,
 "email_address":"support@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "confirmed":0,
 "unsubscribed":0,
 "sms_unsubscribed": "1711958686",
 "rating":1,
 "leadscore":0,
 "sign_up_source" "API"
 },
 {
 "profileid":1099,
 "listid":11,
 "email_address":"contact@marketingplatform.com",
 "mobile":"",
 "mobile_prefix":"",
 "sms_unsubscribed": "1711958686",
 "confirmed":0,
 "unsubscribed":0,
 "rating":1,
 "leadscore":0,
 "sign_up_source" "Zapier"
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get All List For Email Address

Gets all list IDs for a particular email address and returns an array of them.

GET

/Profiles/GetAllListsForEmailAddress/

Parameters:
  • String
    email_address



    The Email Address to be searched for on all Lists.
Response:
  • On success:
    HTTP code 200



    Json array with lists.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetAllListsForEmailAddress?email_address=contact@marketingplatform.com' -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);

$emailaddress = "contact@marketingplatform.com";

$result = $parser->GetAllListsForEmailAddress($emailaddress);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


string emailaddress = "contact@marketingplatform.com";

string result = parser.GetAllListsForEmailAddress(emailaddress);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "listid":2,
 "profileid":2
 },
 {
 "listid":4,
 "profileid":10
 },
 {
 "listid":7,
 "profileid":52
 },
 {
 "listid":11,
 "profileid":1065
 },
 {
 "listid":24,
 "profileid":1096
 },
 {
 "listid":27,
 "profileid":1100
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Get All Lists For Mobile Number

Gets all list IDs for a particular mobile number and returns an array of them.

GET

/Profiles/GetAllListsForMobileNumber/

Parameters:
  • String
    mobile_number



    Mobile number to be searched for on all Lists.
  • String
    mobile_prefix



    Country dialing code.
Response:
  • On success:
    HTTP code 200



    Json array with lists.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetAllListsForMobileNumber?mobile_number=72444444&mobile_prefix=45' -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);

$mobileNumber = "72444444";
$mobilePrefix = "45";

$result = $parser->GetAllListsForMobileNumber($mobileNumber, $mobilePrefix);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string mobileNumber = "72444444";
string mobilePrefix = "45";

string result = parser.GetAllListsForMobileNumber(mobileNumber, mobilePrefix);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "listid":2,
 "profileid":2
 },
 {
 "listid":4,
 "profileid":10
 },
 {
 "listid":7,
 "profileid":52
 },
 {
 "listid":11,
 "profileid":1065
 },
 {
 "listid":24,
 "profileid":1096
 },
 {
 "listid":27,
 "profileid":1100
 }
]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Lead Score

Get lead score for profile.

GET

/LeadScore/

Parameters:
  • Integer
    profileid



    Profile ID.
Response:
  • On success:
    HTTP code 200



    JSON object with profile’s lead score.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/LeadScore?profileid=62'-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);

$profileid = 62;

$result = $parser->GetLeadScore($profileid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 62;

string result = parser.GetLeadScore(profileid);

Sample Response


 {
 "status": true,
 "code": 200,
 "leadScore": 34
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Set Lead Score

Set lead score for a profile.

PUT

/LeadScore/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    lead_score



    Lead score for profile.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/LeadScore'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"profileid":62,"lead_score":34}'
{
 "profileid": 62,
 "lead_score": 34
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 62;
$leadScore = 34;

$result = $parser->SetLeadScore($profileid, $leadScore);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 62;
int leadScore = 34;

string result = parser.SetLeadScore(profileid, leadScore);

Sample Response


{
 "status": true,
 "code": 201,
 "message":"Leadscore has been successfully updated."
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Update Lead Score

Add or reduce lead score for a profile.

POST

/LeadScore/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    lead_score



    Lead score for profile.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/LeadScore'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"profileid":62,"leadscore":10}'
{
 "profileid": 62,
 "lead_score": 10
}
{
 "profileid": 62,
 "lead_score": -5
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$profileid = 62;
$leadScore = 10;

$result = $parser->UpdateLeadScore($profileid, $leadScore);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 62;
int leadScore = 10;

string result = parser.UpdateLeadScore(profileid, leadScore);

Sample Response


{
 "status": true,
 "code": 201,
 "message":"Leadscore has been successfully updated."
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Get Profile Bounces

Get bounces for a profile.

GET

/Profiles/GetProfileBounces/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with bounces.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Profiles/GetProfileBounces?profileid=62&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);

$profileid = 62;
$limit = 10;
$offset = 0;

$result = $parser->GetProfileBounces($profileid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int profileid = 62;
int limit = 10;
int offset = 0;

string result = parser.GetProfileBounces(profileid, limit, offset);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [
 {
 "profileid":62,
 "bounce_time":1552722654,
 "bounce_type":"hard",
 "bounce_rule":10,
 "listid":5,
 "statid":0
 }
 ]
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Stats

Fetch Stats Newsletter

Fetches the details of a newsletter statistics entry.

GET

/Stats/FetchStatsNewsletter/

Parameters:
  • Integer
    statid



    The statistics ID of the entry you want to retrieve from the database.
Response:
  • On success:
    HTTP code 200



    Json objects with stat details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/FetchStatsNewsletter?statid=2'-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);

$statid = 2;

$result = $parser->FetchStatsNewsletter($statid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int statid = 2;

string result = parser.FetchStatsNewsletter(statid);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "newsletterid": 1,
 "statid": 2,
 "start_time": 1623051123,
 "finish_time": 1623052145,
 "send_size": 1636,
 "unsubscribe_count": 1,
 "bouncecount_soft": 24,
 "bouncecount_hard": 9,
 "bouncecount_unknown": 0,
 "link_clicks": 36,
 "email_opens": 703,
 "email_forwards": 0,
 "email_opens_unique": 685,
 "send_type": "newsletter"
 }
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Fetch Stats Autoresponder

Fetches the details of a an autoresponder statistics entry.

GET

/Stats/FetchStatsAutoresponder/

Parameters:
  • Integer
    statid



    The statistics ID of the entry you want to retrieve from the database.
Response:
  • On success:
    HTTP code 200



    Json objects with stats details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/FetchStatsAutoresponder?statid=2'-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);

$statid = 2;

$result = $parser->FetchStatsAutoresponder($statid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int statid = 2;

string result = parser.FetchStatsAutoresponder(statid);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "autoresponderid": 0,
 "statid": 627979,
 "unsubscribe_count": 0,
 "html_recipients": 20,
 "bouncecount_soft": 1,
 "bouncecount_hard": 3,
 "bouncecount_unknown": 0,
 "link_clicks": 12,
 "email_opens": 8,
 "email_forwards": 0,
 "email_opens_unique": 6
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Fetch Stats SMS

Fetches the details of a sms campaign statistics entry.

GET

/Stats/FetchStatsSMS/

Parameters:
  • Integer
    statid



    The statistics ID of the entry you want to retrieve from the database.
Response:
  • On success:
    HTTP code 200



    Json objects with stats details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/FetchStatsSMS?statid=2'-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);

$statid = 2;

$result = $parser->FetchStatsSMS($statid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int statid = 2;

string result = parser.FetchStatsSMS(statid);

Sample Response


{
"status":true,
"code":200,
"data":{
 "statid": 89,
 "start_time": 1552381483,
 "finish_time": 1552381696,
 "sms_campaignid": 2,
 "text_recipients": 10,
 "num_messages": 1,
 "send_size": 11,
 "unsubscribe_count": 0
 }
}

{
 "status": false,
 "code": 403,
 "message": "This user is not owner of the SMS campaign."
}

Get Statids By List

Get all stats IDs by list

GET

/Stats/GetStatidsByList/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json array with stat ids.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetStatidsByList?listid=62&from_date=1578839990&to_date=1579531190&limit=4&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);

$listid = 62;
$fromDate = 1578839990;
$toDate = 1579531190;
$limit = 4;
$offset = 0;

$result = $parser->GetStatidsByList($listid, $fromDate, $toDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 62;
long fromDate = 1578839990;
long toDate = 1579531190;
int limit = 4;
int offset = 0;


string result = parser.GetStatidsByList(listid, fromDate, toDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
	 {
	 "statid":6,
	 "campaignid":2,
	 "campaign_name":"Campaign 1",
	 "type":"newsletter"
	 },
	 {
	 "statid":7,
	 "campaignid":2,
	 "campaign_name":"Campaign 1",
	 "type":"newsletter"
	 },
	 {
	 "statid":8,
	 "campaignid":2,
	 "campaign_name":"Campaign 1",
	 "type":"newsletter"
	 },
	 {
	 "statid":9,
	 "campaignid":2,
	 "campaign_name":"Campaign 1",
	 "type":"newsletter"
	 }
	]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Statids By Segment

Get all stat IDs for the specific segment.

GET

/Stats/GetStatidsBySegment/

Parameters:
  • Integer
    segmentid



    Segment ID.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with stat IDs.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetStatidsBySegment?segmentid=1&from_date=1578839990&to_date=1579531190&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);

$segmentid = 1;
$fromDate = 1578839990;
$toDate = 1579531190;
$limit = 10;
$offset = 0;

$result = $parser->GetStatidsBySegment($segmentid, $fromDate, $toDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 1;
long fromDate = 1578839990;
long toDate = 1579531190;
int limit = 10;
int offset = 0;


string result = parser.GetStatidsBySegment(segmentid, fromDate, toDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "statid":13,
 "newsletter_name":"Campaign 13"
 },
 {
 "statid":14,
 "newsletter_name":"Campaign 14"
 }
 ]
}

{
 "status": false,
 "code": 401,
 "message": "This user is not owner of the Segment."
}

Get Statids By Newsletter

Get all stat IDs for a newsletter.

GET

/Stats/GetStatidsByNewsletter/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with stat IDs.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetStatidsByNewsletter?newsletterid=1&from_date=1578839990&to_date=1579531190&limit=4&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);

$newsletterid = 1;
$fromDate = 1578839990;
$toDate = 1579531190;
$limit = 4;
$offset = 0;

$result = $parser->GetStatidsByNewsletter($newsletterid, $fromDate, $toDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

		string username = 'API_USERNAME';
		string token = 'API_TOKEN';
		 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 1;
long fromDate = 1578839990;
long toDate = 1579531190;
int limit = 4;
int offset = 0;

string result = parser.GetStatidsByNewsletter(newsletterid, fromDate, $toDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "statid":6,
 "newsletter_name":"Campaign 1"
 },
 {
 "statid":7,
 "newsletter_name":"Campaign 1"
 },
 {
 "statid":8,
 "newsletter_name":"Campaign 1"
 },
 {
 "statid":9,
 "newsletter_name":"Campaign 1"
 }
 ]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Statids By Autoresponder

Get all stat IDs for an autoresopnder.

GET

/Stats/GetStatidsByAutoresponder/

Parameters:
  • Integer
    autoresponderid



    Autoresponder ID.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with stat IDs.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetStatidsByAutoresponder?autoresponderid=1&from_date=1578839990&to_date=1579531190&limit=4&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);

$autoresponderid = 1;
$fromDate = 1578839990;
$toDate = 1579531190;
$limit = 4;
$offset = 0;

$result = $parser->GetStatidsByAutoresponder($autoresponderid, $fromDate, $toDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

		string username = 'API_USERNAME';
		string token = 'API_TOKEN';
		 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 1;
long fromDate = 1578839990;
long toDate = 1579531190;
int limit = 4;
int offset = 0;

string result = parser.GetStatidsByAutoresponder(autoresponderid, fromDate, $toDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "statid": 5,
 "autoresponder_name": "Test API v2"
 }
 ]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Bounces By List

Fetches a List of Bounced Emails.

GET

/Stats/GetBouncesByList/

Parameters:
  • Integer
    listid



    List ID from which the results are fetched.
  • Boolean
    count_only



    Whether to return or not the number of Bounces instead of a List of Bounces..
  • String
    bounce_type



    The type of Bounce for which to get results ("soft", "hard", "any").
  • String
    search_type



    Which search rule should be used in date search. Possible values: before, after, between, not, exact/exactly.
  • Timestamp
    search_start_date



    Start Date for filtering.
  • Timestamp
    search_end_date



    End Date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with bounced emails.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetBouncesByList?listid=12&count_only=false&bounce_type=hard&search_type=after&search_start_date=1578839990&search_end_date=1579531190&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);

$listid = 12;
$countOnly = false;
$bounceType = "any";
$searchType = "between";
$searchStartDate = 1578839990;
$searchEndDate = 1579531190;
$limit = 10;
$offset = 0;

$result = $parser->GetBouncesByList($listid, $countOnly, $bounceType, $searchType, $searchStartDate, $searchEndDate, $limit, $offset);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 12;
$countOnly = false;
$bounceType = "hard";
$searchType = "after";
$searchStartDate = 1578839990;
$searchEndDate = 0;
$limit = 10;
$offset = 0;

$result = $parser->GetBouncesByList($listid, $countOnly, $bounceType, $searchType, $searchStartDate, $searchEndDate, $limit, $offset);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 12;
$countOnly = true;
$bounceType = "soft";
$searchType = "exactly";
$searchStartDate = 1578839990;
$searchEndDate= 0;
$limit = 10;
$offset = 0;

$result = $parser->GetBouncesByList($listid, $countOnly, $bounceType, $searchType, $searchStartDate, $searchEndDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
bool countOnly = false;
string bounceType = "any";
string searchType = "between";
string searchStartDate = 1578839990;
string searchEndDate = 1579531190;
int limit = 10;
int offset = 0;

string result = parser.GetBouncesByList(listid, countOnly, bounceType, searchType, searchStartDate, searchEndDate, limit, offset);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
bool countOnly = false;
string bounceType = "hard";
string searchType = "after";
string searchStartDate = 1578839990;
string searchEndDate= 0;
int limit = 10;
int offset = 0;

string result = parser.GetBouncesByList(listid, countOnly, bounceType, searchType, searchStartDate, searchEndDate, limit, offset);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
bool countOnly = true;
string bounceType = "soft";
string searchType = "exactly";
string searchStartDate = 1578839990;
string searchEndDate= 0;
int limit = 10;
int offset = 0;

string result = parser.GetBouncesByList(listid, countOnly, bounceType, searchType, searchStartDate, searchEndDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
	 {
	 "profileid":37,
	 "email_address":"support@marketingplatform.com",
	 "mobile_number":"72444444",
	 "mobile_prefix":"45",
	 "bounce_time":1552722654,
	 "bounce_type":"hard",
	 "bounce_rule":10,
	 "statid":0
	 },
	 {
	 "profileid":56,
	 "email_address":"contact@marketingplatform.com",
	 "mobile_number":"",
	 "mobile_prefix":"",
	 "bounce_time":1576660202,
	 "bounce_type":"unknown",
	 "bounce_rule":"unknown",
	 "statid":0
	 }
	]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Unsubscribes By List

Fetches a list of unsubscribed emails.

GET

/Stats/GetUnsubscribesByList/

Parameters:
  • Integer
    listid



    List ID from which the results are fetched.
  • Boolean
    count_only



    Whether to only return the number of Bounces or not instead of a List of Bounces.
  • String
    search_type



    Which search rule should be used in date search. Possible values: before, after, between, not, exact/exactly.
  • String
    search_start_date



    Start Date for filtering.
  • String
    search_end_date



    End Date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with unsubscribed profiles.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetUnsubscribesByList?listid=12&count_only=false&search_type=after&search_start_date=1578618000&search_end_date=20.01.2020&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);

$listid = 12;
$countOnly = false;
$searchType = "after";
$searchStartDate = 1578618000;
$searchEndDate = 1579482000;
$limit = 10;
$offset = 0;

$result = $parser->GetUnsubscribesByList($listid, $countOnly, $searchType, $searchStartDate, $searchEndDate, $limit, $offset);

print_r($result);
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$listid = 12;
$countOnly = false;
$searchType = "before";
$searchStartDate = 1578618000;
$searchEndDate = 0;
$limit = 10;
$offset = 0;

$result = $parser->GetUnsubscribesByList($listid, $countOnly, $searchType, $searchStartDate, $searchEndDate, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
bool countOnly = false;
string searchType = "between";
string searchStartDate = 1578618000;
string searchEndDate = 1579482000;
int limit = 10;
int offset = 0;

string result = parser.GetUnsubscribesByList(listid, countOnly, searchType, searchStartDate, searchEndDate, limit, offset);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int listid = 12;
bool countOnly = false;
string searchType = "before";
string searchStartDate = 1578618000;
string searchEndDate = 0;
int limit = 10;
int offset = 0;

string result = parser.GetUnsubscribesByList(listid, countOnly, searchType, searchStartDate, searchEndDate, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
	 {
	 "profileid":41,
	 "email_address":"support@marketingplatform.com",
	 "mobile_number":"72444444",
	 "mobile_prefix":"45",
	 "unsubscribe_time":1571658612,
	 "unsubscribe_ip":"127.0.0.1",
	 "device_type":null,
	 "device_os":null,
	 "device_os_version":null
	 },
	 {
	 "profileid":37,
	 "email_address":"contact@marketingplatform.com",
	 "mobile_number":"",
	 "mobile_prefix":"",
	 "unsubscribe_time":1552722637,
	 "unsubscribe_ip":"127.0.0.1",
	 "device_type":"desktop",
	 "device_os":"Linux",
	 "device_os_version":"0"
	 }
	]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Opens

Returns contacts who open an email campaign.

GET

/Stats/GetOpens/

Parameters:
  • Integer
    statid



    Stat ID from which the results are fetched.
  • Boolean
    count_only



    Whether or not to return the number of profiles who have opened a campaign instead of a List of profiles who have opened a campaign.
  • Boolean
    unique_only



    Specify true for count/retrieve unique Opens only, specify false for all Opens.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json objects with profiles who opened an email.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
						 'https://api.mailmailmail.net/v2.0/Stats/GetOpens?statid=12&from_date=1631439780&to_date=1634439780&count_only=false&unique_only=true&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);

$statid = 12;
$dateFrom = 1631439780;
$dateTo = 1634439780;
$countOnly = false;
$onlyUnique = true;
$limit = 10;
$offset = 0;

$result = $parser->GetOpens($statid, $dateFrom, $dateTo, $countOnly, $onlyUnique, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int statid = 12;
int dateFrom = 1631439780;
int dateTo = 1634439780;
bool countOnly = false;
bool onlyUnique = true;
int limit = 10;
int offset = 0;

string result = parser.GetOpens(statid, dateFrom, dateTo, countOnly, onlyUnique, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
	 {
	 "profileid":50,
	 "email_address":"support@marketingplatform.com",
	 "open_time":1552398901,
	 "openip":"1.1.1.1",
	 "open_type":"u",
	 "device_type":"desktop",
	 "device_os":"Linux",
	 "device_version":"0"
	 },
	 {
	 "profileid":50,
	 "email_address":"support@marketingplatform.com",
	 "open_time":1552398952,
	 "openip":"1.1.1.1",
	 "open_type":"u",
	 "device_type":"desktop",
	 "device_os":"Windows",
	 "device_version":"10"
	 },
	 {
	 "profileid":50,
	 "email_address":"support@marketingplatform.com",
	 "open_time":1552399137,
	 "openip":"1.1.1.1",
	 "open_type":"u",
	 "device_type":"phone",
	 "device_os":"Android",
	 "device_version":"7"
	 }
	]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Clicks

Returns profiles who clicked on a link in email campaign.

GET

/Stats/GetClicks/

Parameters:
  • Integer
    statid



    Stat ID from which the results are fetched.
  • Boolean
    count_only



    Whether or not to return the number of profiles who have clicked on a link in campaign instead of a List of profiles who have clicked a link.
  • Boolean
    unique_only



    Specify true for count/retrieve unique Clicks only, specify false for all Clicks.
  • Timestamp
    from_date



    Start date for filtering.
  • Timestamp
    to_date



    End date for filtering.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json objects with profiles who clicked a link.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
 'https://api.mailmailmail.net/v2.0/Stats/GetClicks?statid=12&from_date=1631439780&to_date=1634439780&count_only=false&unique_only=true&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);

$statid = 12;
$dateFrom = 1631439780;
$dateTo = 1634439780;
$countOnly = false;
$onlyUnique = true;
$limit = 10;
$offset = 0;

$result = $parser->GetClicks($statid, $countOnly, $onlyUnique, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int statid = 12;
int dateFrom = 1631439780;
int dateTo = 1634439780;
bool countOnly = false;
bool onlyUnique = true;
int limit = 10;
int offset = 0;

string result = parser.GetClicks(statid, dateFrom, dateTo, countOnly, onlyUnique, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
	 {
	 "profileid":50,
	 "email_address":"test@localhost.dev",
	 "click_time":1552398901,
	 "click_ip":"1.1.1.1",
	 "device_type":"desktop",
	 "device_os":"Linux",
	 "device_version":"0"
	 },
	 {
	 "profileid":50,
	 "email_address":"test@localhost.dev",
	 "click_time":1552398901,
	 "click_ip":"1.1.1.1",
	 "device_type":"desktop",
	 "device_os":"Windows",
	 "device_version":"10"
	 },
	 {
	 "profileid":50,
	 "email_address":"test@localhost.dev",
	 "click_time":1552398901,
	 "click_ip":"1.1.1.1",
	 "device_type":"phone",
	 "device_os":"Android",
	 "device_version":"7"
	 }
	]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Get Newsletter Latest Stats

Get the last statistics for a specific newsletter.

GET

/Stats/GetNewsletterLatestStats/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
Response:
  • On success:
    HTTP code 200



    Json object with newsletter statistics.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetNewsletterLatestStats?newsletterid=2'-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);

$newsletterid = 2;

$result = $parser->GetNewsletterLatestStats($newsletterid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 2;

string result = parser.GetNewsletterLatestStats(newsletterid);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "newsletterid":2,
 "send_type":"newsletter",
 "start_time":1552384758,
 "finish_time":1552398902,
 "recipients":4,
 "email_opens":3,
 "link_clicks":3,
 "email_forwards":0,
 "bounces":0,
 "open_rate":75,
 "click_rate":50
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Snapshots

Get snapshot links for sent campaign, trigger and autoresponder

GET

/Stats/GetSnapshots/

Parameters:
  • Integer
    profileid



    Profile ID.
  • Integer
    triggerid



    Trigger ID.
  • Integer
    autoresponderid



    Autoresponder ID.
  • Integer
    newsletterid



    Campaign ID.
  • String
    group_by



    Group by type/date.
Response:
  • On success:
    HTTP code 200



    Json array with snapshots.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetSnapshots?profileid=178'-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);

$profileid = 178;

$result = $parser->GetSnapshots($profileid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);


int profileid = 178;

string result = parser.GetSnapshots(profileid);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "link":"https://app.marketingplatform.com/snapshot.php?M=XX418&U=XX2&N=XX34&S=XX180&token=XX326c656f6e6964&type=XXn&bd=XX1577919600",
 "time":1577955739,
 "type":"campaign"
 }
 ]
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get List Summary

Calculates the total number of Emails sent, Bounces, Unsubscribes, Opens, Forwards and Link Clicks for a List.

GET

/Stats/GetListSummary/

Parameters:
  • Integer
    listid



    List ID.
  • Timestamp
    from_date



    Start Date for filtering.
  • Timestamp
    to_date



    End Date for filtering.
Response:
  • On success:
    HTTP code 200



    JSON object with details about the Statistics entry.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetListSummary?listid=7&from_date=1578839990&to_date=1579531190'-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);
									 
$listid = 7;
$fromDate = 1578839990;
$toDate = 1579531190;

$result = $parser->GetListSummary($listid, $fromDate, $toDate);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int listid = 7;
long fromDate = 1578839990;
long toDate = 1579531190;

string result = parser.GetListSummary(listid, fromDate, toDate);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "email_sent":20,
 "email_opens":10,
 "email_opens_unique":5,
 "link_clicks":12,
 "link_clicks_unique":10,
 "unsubscribe_count":0,
 "email_forwards":0,
 "bounces":0,
 "open_rate":50,
 "click_rate":60
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Newsletter Summary

Calculates the total number of Emails sent, Bounces, Unsubscribes, Opens, Forwards and Link Clicks for Newsletter

GET

/Stats/GetNewsletterSummary/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
  • Timestamp
    from_date



    Start Date for filtering.
  • Timestamp
    to_date



    End Date for filtering.
Response:
  • On success:
    HTTP code 200



    JSON object with details about the Statistics entry.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetNewsletterSummary?newsletterid=12&from_date=1578667190&to_date=1579531190'-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);
									 
$newsletterid = 12;
$fromDate = 1578667190;
$toDate = 1579531190;

$result = $parser->GetNewsletterSummary($newsletterid, $fromDate, $toDate);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int newsletterid = 12;
long fromDate = 1578667190;
long toDate = 1578839990;

string result = parser.GetNewsletterSummary(newsletterid, fromDate, toDate);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "email_sent":15,
 "email_opens":2,
 "email_opens_unique":1,
 "link_clicks":1,
 "link_clicks_unique":1,
 "unsubscribes":1,
 "email_forwards":1,
 "bounces":1,
 "open_rate":6.67,
 "click_rate":6.67
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Trigger Summary

Calculates the total number of Emails sent, Bounces, Unsubscribes, Opens, Forwards and Link Clicks for Trigger

GET

/Stats/GetTriggerSummary/

Parameters:
  • Integer
    triggerid



    Trigger ID.
  • Timestamp
    from_date



    Start Date for filtering.
  • Timestamp
    to_date



    End Date for filtering.
Response:
  • On success:
    HTTP code 200



    JSON object with details about the Statistics entry.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetTriggerSummary?triggerid=12&from_date=1578667190&to_date=1579531190'-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);
									 
$triggerid = 12;
$fromDate = 1578667190;
$toDate = 1579531190;

$result = $parser->GetTriggerSummary($triggerid, $fromDate, $toDate);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int triggerid = 12;
long fromDate = 1578667190;
long toDate = 1578839990;

string result = parser.GetTriggerSummary(triggerid, fromDate, toDate);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "email_sent":570,
 "email_opens":617,
 "email_opens_unique":318,
 "link_clicks":444,
 "link_clicks_unique":320,
 "unsubscribes":1,
 "email_forwards":0,
 "bounces":0,
 "open_rate":55.79,
 "click_rate":56.14
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Autoresponder Summary

Calculates the total number of Emails sent, Bounces, Unsubscribes, Opens, Forwards and Link Clicks for Autoresponder

GET

/Stats/GetAutoresponderSummary/

Parameters:
  • Integer
    autoresponderid



    Autoresponderid ID.
  • Timestamp
    from_date



    Start Date for filtering.
  • Timestamp
    to_date



    End Date for filtering.
Response:
  • On success:
    HTTP code 200



    JSON object with details about the Statistics entry.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetAutoresponderSummary?autoresponderid=12&from_date=1578667190&to_date=1579531190'-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);
									 
$autoresponderid = 12;
$fromDate = 1578667190;
$toDate = 1579531190;

$result = $parser->GetAutoresponderSummary($autoresponderid, $fromDate, $toDate);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int autoresponderid = 12;
long fromDate = 1578667190;
long toDate = 1578839990;

string result = parser.GetAutoresponderSummary(autoresponderid, fromDate, toDate);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "email_sent":2,
 "email_opens":2,
 "email_opens_unique":1,
 "link_clicks":2,
 "link_clicks_unique":1,
 "unsubscribes":1,
 "email_forwards":0,
 "bounces":0,
 "open_rate":50,
 "click_rate":50
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Get Segment Summary

Calculates the total number of Emails sent, Bounces, Unsubscribes, Opens, Forwards and Link Clicks for Segment

GET

/Stats/GetSegmentSummary/

Parameters:
  • Integer
    segmentid



    Segment ID.
  • Timestamp
    from_date



    Start Date for filtering.
  • Timestamp
    to_date



    End Date for filtering.
Response:
  • On success:
    HTTP code 200



    JSON object with details about the Statistics entry.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Stats/GetSegmentSummary?segmentid=12&from_date=1578667190&to_date=1579531190'-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);
									 
$segmentid = 12;
$fromDate = 1578667190;
$toDate = 1579531190;

$result = $parser->GetSegmentSummary($segmentid, $fromDate, $toDate);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int segmentid = 12;
long fromDate = 1578667190;
long toDate = 1578839990;

string result = parser.GetSegmentSummary(segmentid, fromDate, toDate);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "email_sent":20,
 "email_opens":10,
 "email_opens_unique":5,
 "link_clicks":12,
 "link_clicks_unique":10,
 "unsubscribes":0,
 "email_forwards":0,
 "bounces":0,
 "open_rate":50,
 "click_rate":60
 }
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Send

Schedule Send Newsletter

Schedule email campaign for sending.

POST

/Sends/ScheduleSendNewsletter/

Parameters:
  • Integer
    newsletterid



    Campaign ID that is to be scheduled for sending.
  • Float
    time_to_send



    When the campaign sending should start (in how many hours from a starting point (real time : now)).
  • Boolean
    save_snapshots



    Whether to save snapshot or not.
  • Boolean
    reload_feed



    Whether to reload feed before sending or not.
    We are reloading the feed in smart intervals depending how frequently you get new products, so there is no need to reload before sending unless the item merged in the email is added to the product feed at the moment of sending.
  • Boolean
    notify_owner



    The owner will be notified when a newsletter has started and finished sending or when an issue occurs with the sending.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Sends/ScheduleSendNewsletter' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":50,"time_to_send":2,"save_snapshots":false,"reload_feed":true}'
{
 "newsletterid": 50, 
 "time_to_send": 2,
 "save_snapshots": false,
 "reload_feed": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$newsletterid = 50;
$timeToSend = 2; //Send 2 hours form now.
$saveSnapshots = false;
$reloadFeed = true;

$result = $parser->ScheduleSendNewsletter($newsletterid, $timeToSend, $saveSnapshots, $reloadFeed);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 50;
float timeToSend = 2; //Send 2 hours form now.
bool saveSnapshots = false;
bool reloadFeed = true;

string result = parser.ScheduleSendNewsletter(newsletterid, timeToSend, saveSnapshots, reloadFeed);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Campaign has been scheduled"
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Schedule SendNewsletter To List

Schedule email campaign for sending to specific lists.

POST

/Sends/ScheduleSendNewsletterToList/

Parameters:
  • Integer
    newsletterid



    Campaign ID that is to be scheduled.
  • Array
    listid



    Array of list ids for campaign to be scheduled.
  • Float
    time_to_send



    When the campaign sending should start (in how many hours from a starting point (real time : now)).
  • Boolean
    save_snapshots



    Whether to save snapshot or not.
  • Boolean
    reload_feed



    Whether to reload feed before sending or not.
    We are reloading the feed in smart intervals depending how frequently you get new products, so there is no need to reload before sending unless the item merged in the email is added to the product feed at the moment of sending.
  • Boolean
    notify_owner



    The owner will be notified when a newsletter has started and finished sending or when an issue occurs with the sending.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Sends/ScheduleSendNewsletterToList' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":50,"listid":[250],"time_to_send":2,"save_snapshots":true,"reload_feed":true}'
{
 "newsletterid": 50,
 "listid": [250],
 "time_to_send": 2,
 "save_snapshots": true,
 "reload_feed": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$newsletterid = 50;
$listid[] = 250;
$timeToSend = 2; //Send 2 hours form now.
$saveSnapshots = true;
$reloadFeed = true;

$result = $parser->ScheduleSendNewsletterToList($newsletterid, $listid, $timeToSend, $saveSnapshots, $reloadFeed);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 50;
int[] listids = new int[] { 250,251 };
float timeToSend = 2; //Send 2 hours form now.
bool saveSnapshots = true;
bool reloadFeed = true;

string result = parser.ScheduleSendNewsletterToList(newsletterid, listids, timeToSend, saveSnapshots, reloadFeed);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Campaign has been scheduled"
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter"
}

Schedule SendNewsletter To Segment

Schedule email campaign for sending to specific segments.

POST

/Sends/ScheduleSendNewsletterToSegment/

Parameters:
  • Integer
    newsletterid



    Campaign ID that is to be scheduled.
  • Array
    segmentid



    Array of segment ids for campaign to be scheduled.
  • Float
    time_to_send



    When the campaign sending should start (in how many hours from a starting point (real time : now)).
  • Boolean
    save_snapshots



    Whether to save snapshot or not.
  • Boolean
    reload_feed



    Whether to reload feed before sending or not.
    We are reloading the feed in smart intervals depending how frequently you get new products, so there is no need to reload before sending unless the item merged in the email is added to the product feed at the moment of sending.
  • Boolean
    notify_owner



    The owner will be notified when a newsletter has started and finished sending or when an issue occurs with the sending.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Sends/ScheduleSendNewsletterToSegment' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":50,"segmentid":[20],"time_to_send":2,"save_snapshots":true,"reload_feed":true}'
{
 "newsletterid": 50,
 "segmentid": [20],
 "time_to_send": 2,
 "save_snapshots": true,
 "reload_feed": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$newsletterid = 50;
$segmentid[] = 20;
$timeToSend = 2; //Send 2 hours form now.
$saveSnapshots = true;
$reloadFeed = true;

$result = $parser->ScheduleSendNewsletterToSegment($newsletterid, $segmentid, $timeToSend, $saveSnapshots, $reloadFeed);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 50;
int[] segmentids = new int[] { 20, 21 };
float timeToSend = 2; //Send 2 hours form now.
bool saveSnapshots = true;
bool reloadFeed = true;

string result = parser.ScheduleSendNewsletterToSegment(newsletterid, segmentids, timeToSend, saveSnapshots, reloadFeed);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Campaign has been scheduled"
}

{
 "status": false,
 "code": 403,
 "message": "This user is not owner of the newsletter."
}

Schedule SendSMS

Schedule SMS campaign for sending.

POST

/SMSSends/ScheduleSendSMS/

Parameters:
  • Integer
    campaignid



    Campaign ID that is to be scheduled.
  • Float
    time_to_send



    When the campaign sending should start (in how many hours from a starting point (real time : now)).
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/SMSSends/ScheduleSendSMS' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"campaignid": 50,"time_to_send": 1}'
{
 "campaignid": 50,
 "time_to_send": 1
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$campaignid = 50;
$timeToSend = 1; // Send 1 hour form now.

$result = $parser->ScheduleSendSMS($campaignid, $timeToSend);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int campaignid = 50;
float timeToSend = 1; // Send 1 hour form now.

string result = parser.ScheduleSendSMS(newsletterid, timeToSend);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Campaign has been scheduled"
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Send Newsletter

Attempts to send a newsletter to a specific profile. Profile has to be on the list/segment specified for given newsletter.

POST

/Messaging/SendNewsletter/

Parameters:
  • Integer
    newsletterid



    Newsletter ID that will be sent.
  • Integer
    profileid



    Recipient profile's ID.
  • String
    email_address



    Email address used to find recipient from all possible recipients of the newsletter.
  • String
    call_back_url



    Callback url for tracking status of sending.
  • Boolean
    notify_owner



    The owner will be notified when a newsletter has started and finished sending or when an issue occurs with the sending.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Messaging/SendNewsletter' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":50,"profileid":150,"email_address":"contact@marketingplatform.com","call_back_url":"http:\/\/api.mailmailmail.net\/callback"}'
{
 "newsletterid": 50,
 "profileid": 150,
 "email_address": "contact@marketingplatform.com",
 "call_back_url": "http://api.mailmailmail.net/callback"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$newsletterid = 50;
$profileid = 150;
$emailaddress = "contact@marketingplatform.com";
$callbackUrl = "http://api.mailmailmail.net/callback";

$result = $parser->SendNewsletter($newsletterid, $profileid, $emailaddress, $callbackUrl);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 50;
int profileid = 150;
string emailaddress = "contact@marketingplatform.com";
string callbackUrl = "http://api.mailmailmail.net/callback";

string result = parser.SendNewsletter(newsletterid, profileid, emailaddress, callbackUrl);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Profile was added to send newsletter queue."
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Newsletters

GetNewsletters

Get a List of Newsletters.

GET

/Newsletters/

Parameters:
  • Integer
    newsletterid



    Newsletter ID of a campaign you wish to get an overview of. HTML code included also.
  • Boolean
    count_only



    Whether or not to get a count only of Lists, rather than the information only.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with newsletters.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
						 'https://api.mailmailmail.net/v2.0/Newsletters?newsletterid=0&countOnly=false&limit=2&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);

$newsletterid = 0; // if newsletterid is set up, then response will be only with selected newsletter data
$countOnly = false;
$limit = 2;
$offset = 0;

$result = $parser->GetNewsletters(newsletterid, $countOnly, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 0; // if newsletterid is set up, then response will be only with selected newsletter data
bool countOnly = false;
int limit = 2;
int offset = 0;

string result = parser.GetNewsletters(newsletterid, countOnly, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "newsletterid":1,
 "name":"Newsletter name",
 "subject":"Newsletter subject",
 "active":1,
 "create_date":1613119186,
 "update_date":1616410086,
 "selected_lists":[
 6
 ],
 "selected_segments":[
 
 ],
 "url":"https://app.marketingplatform.com/display.php?N=1&T=933c3640325"
 },
 {
 "newsletterid":2,
 "name":"Newsletter name 2",
 "subject":"Newsletter subjects 2",
 "active":1,
 "create_date":1613119194,
 "update_date":1613120415,
 "selected_lists":[
 6
 ],
 "selected_segments":[
 
 ],
 "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!"
}

Edit Newsletter

Change the name and the subject of a newsletter.

PUT

/Newsletters/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
  • String
    name



    New name of the newsletter.
  • String
    subject



    New subject of the newsletter.
Response:
  • On success:
    HTTP code 200



    JSON array with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Newsletters/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":7,"name":"Test Name 2","subject":"Test Subject 2"}'
{
 "newsletterid": 7,
 "name": "Test Name 2",
 "subject": "Test Subject 2"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";
									 
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

									 
$parser = new ApiParser($settings);
									 
$newsletterid = 7;
$newsletterName = "Test Name 2";
$newsletterSubject = "Test Subject 2";

$result = $parser->EditNewsletter($newsletterid, $newsletterName, $newsletterSubject);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
									 
ApiParser parser = new ApiParser(username, token);
									 
int newsletterid = 7;
string newsletterName = "Test Name 2";
string newsletterSubject = "Test Subject 2";

string result = parser.EditNewsletter(newsletterid, newsletterName, newsletterSubject);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Your email campaign has been updated."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Delete Newsletter

Delete a Newsletter from the database.

DELETE

/Newsletters/

Parameters:
  • Integer
    newsletterid



    Newsletter ID that will be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Newsletters?newsletterid=12 -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);

$newsletterid = 12;

$result = $parser->DeleteNewsletter($newsletterid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int newsletterid = 12;

string result = parser.DeleteNewsletter(newsletterid);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Newsletter has been deleted"
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Copy Newsletter

Copy a newsletter along with attachments, images etc.

POST

/Newsletters/CopyNewsletter/

Parameters:
  • Integer
    newsletterid



    Newsletter ID.
  • String
    name



    New name of the newsletter.
  • String
    subject



    New subject of the newsletter.
Response:
  • On success:
    HTTP code 200



    JSON object with copied newsletter ID.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Newsletters/CopyNewsletter' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"newsletterid":7,"name":"Test Name 2","subject":"Test Subject 2"}'
{
 "newsletterid": 8,
 "name": "Newsletter Name",
 "subject": "Newsletter Subject"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";
									 
$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

									 
$parser = new ApiParser($settings);
									 
$newsletterid = 7;
$newsletterName = "Test Name 2";
$newsletterSubject = "Test Subject 2";

$result = $parser->CopyNewsletter($newsletterid, $newsletterName, $newsletterSubject);

print_r($result);
using MarketingPlatform;
									 
string username = 'API_USERNAME';
string token = 'API_TOKEN';
 
										 
ApiParser parser = new ApiParser(username, token);
									 
int newsletterid = 7;
string newsletterName = "Test Name 2";
string newsletterSubject = "Test Subject 2";

string result = parser.CopyNewsletter(newsletterid, newsletterName, newsletterSubject);

Sample Response


{
 "status":true,
 "code":200,
 "newsletterid":47
}

{
 "status":false,
 "code":400,
 "message":"The requested newsletter belongs to other user!"
}

Feeds

Get Feeds

Makes a request call on all the Feeds that this user either owns or has access to.

GET

/Feeds/

Parameters:
  • Integer
    feedid



    Feed ID to load.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with List details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Feeds?feedid=12&limit=1&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php"; $settings = array(); $settings['username'] = "API_USERNAME"; $settings['token'] = "API_TOKEN"; $parser = new ApiParser($settings); $feedid = 0; // if feedid is set up, then response will be only with selected feed data $limit = 1; $offset = 0; $result = $parser->GetFeeds(feedid, $limit, $offset); print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
		
int limit = 1;
int offset = 0;

string result = parser.GetFeeds(limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "feedid": 10,
 "name": "GShop - MarketingPlatform",
 "url": "https://marketingplatform.com/example_feed.json",
 "type": "json"
 }
 ]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Reload Feed

Reload feed

POST

/Feeds/ReloadFeed/

Parameters:
  • String
    feed_url



    URL for feed.
Response:
  • On success:
    HTTP code 200



    Json object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Feeds/ReloadFeed' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"feed_url":"http://feedurl.com"}'
{
 "feed_url": "http://feedurl.com""
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$feedURL = "http://feedurl.com";

$result = $parser->ReloadFeed($feedURL);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string feedURL = "http://feedurl.com";

string result = parser.ReloadFeed(feedURL);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Feed has been successfuly reloaded"
}

{
 "status": false,
 "code": 400,
 "message": "Missing required parameter."
}

Autoresponders

GetAutoresponders

Makes a request call on all the Autoresponders that this user either owns or has access to.

GET

/Autoresponders/

Parameters:
  • Integer
    autoresponderid



    Autoresponder ID to load.
  • Integer
    listid



    Specify listid if you want to get autoresponders only for specific list.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with List details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
 'https://api.mailmailmail.net/v2.0/Autoresponders?autoresponderid=0&limit=1&offset=0' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php"; $settings = array(); $settings['username'] = "API_USERNAME"; $settings['token'] = "API_TOKEN"; $parser = new ApiParser($settings); $autoresponderid = 0; // if autoresponderid is set up, then response will be only with selected autoresponder data $limit = 1; $offset = 0; $result = $parser->GetAutoresponders(autoresponderid, $limit, $offset); print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
		
int autoresponderid = 0; // if autoresponderid is set up, then response will be only with selected autoresponder data
int limit = 1;
int offset = 0;

string result = parser.GetAutoresponders(autoresponderid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "autoresponderid": 10,
 "name": "Autoresponder - MarketingPlatform",
 "subject": "Autoresponder - MarketingPlatform",
 "create_date": 1617311640,
 "status": 1,
 "send_after_subscription_hours": 2,
 "listid": 1,
 "send_from_name": "Support MarketingPlatform",
 "send_from_email": "support@marketingplatform.com",
 "reply_to_email": "support@marketingplatform.com",
 "bounce_email": "support@marketingplatform.com",
 "newsletterid": 23
 },
 {
 "autoresponderid": 11,
 "name": "Welcome Autoresponder",
 "subject": "Welcome Autoresponder",
 "create_date": 1617341640,
 "status": 1,
 "send_after_subscription_hours": 1,
 "listid": 2,
 "send_from_name": "Support MarketingPlatform",
 "send_from_email": "support@marketingplatform.com",
 "reply_to_email": "support@marketingplatform.com",
 "bounce_email": "support@marketingplatform.com",
 "newsletterid": 24
	}
 ]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Set Autoresponder Status

Activate/Deactivate Autoresponder.

PUT

/Autoresponders/

Parameters:
  • Integer
    autoresponderid



    Autoresponder ID.
  • Boolean
    status



    New status for autoresponder.
Response:
  • On success:
    HTTP code 200



    Json object with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Autoresponders/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"autoresponderid":12,"status":true}'
{
 "autoresponderid": 12,
 "status": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$autoresponderid = 12;
$status = true; // Active = true; Disabled = false

$result = $parser->SetAutoresponderStatus($autoresponderid, $status);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int autoresponderid = 12;
bool status = true;

string result = parser.SetAutoresponderStatus(autoresponderid, status);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Autoresponder updated successfully."
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the autoresponder"
}

Delete Autoresponders

Delete a Autoresponder from the database.

DELETE

/Autoresponders/

Parameters:
  • Integer
    autoresponderid



    Autoresponder ID to be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Autoresponders?autoresponderid=20 -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);

$autoresponderid = 26;

$result = $parser->DeleteAutoresponder($autoresponderid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int autoresponderid = 26;

string result = parser.DeleteAutoresponder(autoresponderid);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Autoresponder has been deleted."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Triggers

Get Triggers

Get a list of triggers.

GET

/Triggers/

Parameters:
  • Integer
    triggerid



    Trigger ID to load.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with triggers.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
						 'https://api.mailmailmail.net/v2.0/Triggers?triggerid=0&limit=2&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);

$triggerid = 0; // if triggerid is set up, then response will be only with selected trigger data
$limit = 2;
$offset = 0;

$result = $parser->GetTriggers(triggerid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int triggerid = 0; // if triggerid is set up, then response will be only with selected trigger data
int limit = 2;
int offset = 0;

string result = parser.GetTriggers(triggerid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "triggerid":1,
 "status":1,
 "create_date":1616583076,
 "name":"test",
 "trigger_type":"Based on a contact's date field",
 "trigger_hours":0,
 "trigger_interval":"The next anniversary of the date"
 }
 ]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Set Trigger Status

Activate/Deactivate Trigger.

PUT

/Triggers/

Parameters:
  • Integer
    triggerid



    Trigger ID.
  • Boolean
    status



    New status for trigger.
Response:
  • On success:
    HTTP code 200



    JSON object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Triggers/' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"triggerid":11,"status":true}'
{
 "triggerid": 11,
 "status": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$triggerid = 11;
$status = true; // Active = true; Disabled = false

$result = $parser->SetTriggerStatus($triggerid, $status);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int triggerid = 11;
bool status = true; // Active = true; Disabled = false

string result = parser.SetTriggerStatus(triggerid, status);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Trigger has been updated"
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the trigger"
}

Delete Trigger

Delete a Trigger from the database.

DELETE

/Triggers/

Parameters:
  • Integer
    triggerid



    Trigger ID to be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Triggers?triggerid=26 -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);

$triggerid = 26;

$result = $parser->DeleteTrigger($triggerid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int triggerid = 26;

string result = parser.DeleteTrigger(triggerid);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Trigger has been deleted."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Get Triggers For Segment

Get a list of triggers for the segment.

GET

/Triggers/GetTriggersForSegment/

Parameters:
  • Integer
    segmentid



    List ID.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with triggers.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Triggers/GetTriggersForSegment?segmentid=9&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);

$segmentid = 9;
$limit = 2;
$offset = 0;

$result = $parser->GetTriggersForSegment($segmentid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 9;
int limit = 2;
int offset = 0;

string result = parser.GetTriggersForSegment(segmentid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "triggeremailsid":3,
 "status":1,
 "create_date":1581071887,
 "name":"Link Clicked",
 "trigger_type":"Based on a link being clicked",
 "trigger_hours":0,
 "trigger_interval":"The next anniversary of the date"
 },
 {
 "triggeremailsid":4,
 "active":1,
 "create_date":1581514267,
 "ownerid":2,
 "name":"Trigger for Segment",
 "trigger_type":"Based on a specific date",
 "trigger_hours":0,
 "trigger_interval":"The next anniversary of the date"
 }
 ]
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the segment."
}

Flows

Get Flows

Makes a request call on all the Flows that this user either owns or has access to.

GET

/Flows/

Parameters:
  • Integer
    flowid



    Flow ID to load.
  • Integer
    limit



    Number of records to return.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    JSON object with Flow details.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
 'https://api.mailmailmail.net/v2.0/FLows?flowid=0&limit=1&offset=0'
 -H 'Apiusername: API_USERNAME' 
 -H 'Apitoken: API_TOKEN'
  -H 'Content-Type: application/json'
require_once dirname(__FILE__) . "/ApiParser.class.php"; $settings = array(); $settings['username'] = "API_USERNAME"; $settings['token'] = "API_TOKEN"; $parser = new ApiParser($settings); $flowid = 0; // if flowid is set up, then response will be only with selected flow data $limit = 1; $offset = 0; $result = $parser->GetFlows($flowid, $limit, $offset); print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);
		
int flowid = 0;
int limit = 1;
int offset = 0;

string result = parser.GetFlows(flowid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "flowid": 10,
 "name": "Flow - MarketingPlatform",
 "create_date": 1568733174,
 "update_date": 1568733174,
 "active": true
 }
 ]
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Set Flow Status

Activate/Deactivate Flow.

PUT

/Flows/

Parameters:
  • Integer
    flowid



    Flow ID.
  • Boolean
    status



    New status for flow.
Response:
  • On success:
    HTTP code 200



    Json object with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 
	 'https://api.mailmailmail.net/v2.0/Flows/'
	 -H 'Apiusername: API_USERNAME' 
	 -H 'Apitoken: API_TOKEN'
	 -H 'Content-Type: application/json'
	 -d '{"flowid":12,"status":true}'
{
 "flowid": 12,
 "status": true
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$flowid = 12;
$status = true; // Active = true; Disabled = false

$result = $parser->SetFlowStatus($flowid, $status);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int flowid = 12;
bool status = true;

string result = parser.SetFlowStatus(flowid, status);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Flow updated successfully."
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the flow"
}

Segments

Get Segments

Get segments.

GET

/Segments/

Parameters:
  • Integer
    segmentid



    Segment ID to load.
  • Integer
    listid



    Specify listid if you want to get segmetns only for specific list.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with segments.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 
						 'https://api.mailmailmail.net/v2.0/Segments?segmentid=0&listid=9&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);

$segmentid = 0; // if segmentid is set up, then response will be only with selected segment data
$listid = 9;
$limit = 1;
$offset = 0;

$result = $parser->GetSegments($segmentid, $listid, $limit, $offset);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 0; // if segmentid is set up, then response will be only with selected segment data
int listid = 9;
int limit = 1;
int offset = 0;

string result = parser.GetSegments(segmentid, listid, limit, offset);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "segmentid":1,
 "segment_name":"Test GetStatidsBySegment",
 "create_date":1580307521,
 "update_date":1580307521,
 "used_lists":[
 9
 ],
 "search_info":{
 "Lists":[
 [
 9
 ]
 ],
 "Rules":[
 [
 {
 "type":"group",
 "rules":[
 {
 "type":"rule",
 "connector":"and",
 "rules":{
 "ruleName":"emailaddress",
 "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!"
}

Create Segment

Create a segment with specific rules.

POST

/Segments/

Parameters:
  • String
    name



    Name of segment.
  • Array
    rules



    Rules for segment.
  • String
    connector



    Matching all rules or any rules, and/or.
Response:
  • On success:
    HTTP code 200



    JSON array with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Segments'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"name":"Segment Name","rules":{"Segments":[{"listids":[205],"rules":[{"ruleName":"emailaddress","ruleOperator":"=","ruleValues":["contact@marketingplatform.com"]}]}]},"connector":"and"}'

{
 "name": "Segment Name",
 "rules": {
	"Segments": [{
		"listids": [205],
		"rules": [{
			"ruleName": "emailaddress",
			"ruleOperator": "=",
			"ruleValues": ["contact@marketingplatform.com"]
		}]
	}]
 },
 "connector": "and"
}

{
 "name": "Segment Name",
 "rules": {
	"Segments": [{
		"listids": [205],
		"rules": [{
			"ruleName": "emailaddress",
			"ruleOperator": "like",
			"ruleValues": ["marketingplatform.com"]
		},
		{
			"ruleName": "confirmationStatus",
			"ruleOperator": "=",
			"ruleValues": ["confirmed"]
		}]
	}]
 },
 "connector": "and"
}

{
	"name": "Combine segments",
	"rules": {
		"Segments": [{
			"operator":"plus",
			"listids": [1256],
			"rules": [{
				"ruleName": "emailaddress",
				"ruleOperator": "contains",
				"ruleValue": "John"
			}]
		}, {
			"listids": [1256],
			"operator":"plus",
			"rules": [{
				"ruleName": "emailaddress",
				"ruleOperator": "contains",
				"ruleValue": "@marketingplatform.com"
			}]
		}]
	},
	"connector": "and"
}

{
 "name": "Segment name with path rule for lvl 1 OTM",
 "rules": {
 "Segments": [
 {
 "listids": [205],
 "rules": [
 {
 "ruleName": "162",
 "ruleOperator": "equalto",
 "ruleValues": ["John"],
 "path": "Item",
 "type": "text",
 "ruleNameField": "MyOneToMany",
 "connector": "and"
 }
 ]
 }
 ]
 },
 "connector": "and"
}

{
 "name": "Segment name with path rule for lvl 2 OTM",
 "rules": {
 "Segments": [
 {
 "listids": [205],
 "rules": [
 {
 "ruleName": "162",
 "ruleOperator": "equalto",
 "ruleValues": ["John"],
 "path": "OrderItems.Item",
 "type": "text",
 "ruleNameField": "MyOneToMany",
 "connector": "and"
 }
 ]
 }
 ]
 },
 "connector": "and"
}

{
 "name": "Segment name with path rule for lvl 3 OTM",
 "rules": {
 "Segments": [
 {
 "listids": [205],
 "rules": [
 {
 "ruleName": "162",
 "ruleOperator": "equalto",
 "ruleValues": ["John"],
 "path": "Orders.OrderItems.Item",
 "type": "text",
 "ruleNameField": "MyOneToMany",
 "connector": "and"
 }
 ]
 }
 ]
 },
 "connector": "and"
}

{
 "name": "Segment with OTM and simple rule",
 "connector": "and",
 "rules": {
 "Segments": [
 {
 "listids": [205],
 "rules": [
 {
 "ruleName": "162",
 "ruleOperator": "equalto",
 "ruleValues": ["John"],
 "path": "OrderItems.Item",
 "type": "text",
 "ruleNameField": "MyOneToMany",
 "connector": "and"
 },
 {
 "ruleName": "emailaddress",
 "ruleOperator": "equalto",
 "ruleValues": ["email@marketingplatform.com"],
 "connector": "and"
 },
 {
 "ruleName": "164",
 "ruleOperator": "equalto",
 "ruleValues": ["dog"],
 "path": "UserInfo.DogDetails.DogName",
 "type": "text",
 "ruleNameField": "MyOneToManyOther",
 "connector": "and"
 }
 ]
 }
 ]
 }
}

Basic fields Custom fields 
 
emailaddress Rule name is id of custom field
mobilePhone
format
confirmationStatus
activityStatus
smsStatus
mailRating
dateAdded
clickedOnLink
emailCampaign
subscriberSource


Rules
'='=>is/ equal 'empty'=>is empty 
'='=>is on 'notEmpty'=>isnot empty
'='=> has clicked 'after'=>is after
'!='=>isnot/not equal 'before'=>is before
'!='=> has not clicked 'between'=>is between
'!='=>isnot on 'opened'=> has opened
'contains'=> contains 'notOpened'=> has not opened
'notContain'=> does not contain 'sent'=> sent
'notSent'=>not sent 'greaterthan'=> greaterthan
'lessthan'=> lessthan 


Values'html'=> HTML 'any'=>AnyLink'text'=>Text'any'=>AnyEmailCampaign'confirmed'=>Confirmed'lastMonth'=>AnyCampaignLastMonth'unconfirmed'=>Unconfirmed'last3Months'=>AnyCampaignLast3Months'active'=>Active'last6Months'=>AnyCampaignLast6Months'bounced'=>Bounced'last9Months'=>AnyCampaignLast9Months'unsubscribed'=>Unsubscribed'last12Months'=>AnyCampaignLast12Months'disabled'=>Disabled'facebook'=>Facebook'webForm'=>WebForm'connector'=>Connector'import'=>Import'unknown'=>Unknown'manual'=>Manual
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$name = "Segment Name"; 
$rules = array (
 "Segments" => array (
 array (
 "listids" => array(205),
 "rules" => array (
 array (
 "ruleName" => "emailaddress",
 "ruleOperator" => "=",
 "ruleValues" => array("contact@marketingplatform.com")
 )
 )
 )
 	 )
);
$connector = "and";

$result = $parser->CreateSegment($name, $rules, $connector);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

string name = "Segment Name";
string connector = "and";

Dictionary<string, object> allSegments = new Dictionary<string, object>();

Dictionary<string, object>[] segments = new Dictionary<string, object>[1];
Dictionary<string, object> segment = new Dictionary<string, object>();

Dictionary<string, object>[] rules = new Dictionary<string, object>[1];
Dictionary<string, object> rule = new Dictionary<string, object>();

rule.Add("ruleName", "emailaddress");
rule.Add("ruleOperator", "=");
rule.Add("ruleValues", new string[] {"contact@marketingplatform.com"});

rules[0] = rule;

segment.Add("listids", new int[] { 205 });
segment.Add("rules", rules);

segments[0] = segment;

allSegments.Add("Segments", segments);

string result = parser.CreateSegment(name, allSegments, connector);

Sample Response


{
 "status":true,
 "code":201,
 "segmentid":342
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Edit Segment

Create a segment with specific rules.

Put

/Segments/

Parameters:
  • Integer
    segmentid



    Segment ID to be edited.
  • String
    name



    Name of segment.
  • Array
    rules



    Rules for segment.
  • String
    connector



    Matching all rules or any rules, and/or.
Response:
  • On success:
    HTTP code 200



    JSON array with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Segments'-H'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H'Content-Type: application/json'-d'{"segmentid":112,"name":"Segment Name","rules":{"Segments":[{"listids":[205],"rules":[{"ruleName":"emailaddress","ruleOperator":"=","ruleValues":["contact@marketingplatform.com"]}]}]},"connector":"and"}'
{
 "segmentid": 112,
 "name": "Segment Name",
 "rules": {
	"Segments": [{
		"listids": [205],
		"rules": [{
			"ruleName": "emailaddress",
			"ruleOperator": "=",
			"ruleValues": ["contact@marketingplatform.com"]
		}]
	}]
 },
 "connector": "and"
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";

$parser = new ApiParser($settings);

$segmentid = 112;
$name = "Segment Name"; 
$rules = array (
 "Segments" => array (
 array (
 "listids" => array(205),
 "rules" => array (
 array (
 "ruleName" => "emailaddress",
 "ruleOperator" => "=",
 "ruleValues" => array("contact@marketingplatform.com")
 )
 )
 )
 	 )
);
$connector = "and";

$result = $parser->EditSegment($segmentid, $name, $rules, $connector);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 112;
string name = "Segment Name";
string connector = "and";

Dictionary<string, object> allSegments = new Dictionary<string, object>();

Dictionary<string, object>[] segments = new Dictionary<string, object>[1];
Dictionary<string, object> segment = new Dictionary<string, object>();

Dictionary<string, object>[] rules = new Dictionary<string, object>[1];
Dictionary<string, object> rule = new Dictionary<string, object>();

rule.Add("ruleName", "emailaddress");
rule.Add("ruleOperator", "=");
rule.Add("ruleValues", new string[] {"contact@marketingplatform.com"});

rules[0] = rule;

segment.Add("listids", new int[] { 205 });
segment.Add("rules", rules);

segments[0] = segment;

allSegments.Add("Segments", segments);

string result = parser.EditSegment(segmentid, name, allSegments, connector);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Segment has been successfully updated"
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}

Delete Segment

Delete a Segment from the database.

DELETE

/Segments/

Parameters:
  • Integer
    segmentid



    Segment ID to be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with confirmation message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE  ''https://api.mailmailmail.net/v2.0/Segments?segmentid=26-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);

$segmentid = 26;

$result = $parser->DeleteSegment($segmentid);

print_r($result);
using MarketingPlatform;

string username = 'API_USERNAME';
string token = 'API_TOKEN';
 

ApiParser parser = new ApiParser(username, token);

int segmentid = 26;

string result = parser.DeleteSegment(segmentid);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Segment has been deleted."
}

{
 "status":false,
 "code":401,
 "message":"You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Users

Users

Get SubAccounts

Get a list of SubAccounts.

GET

/Users/SubAccounts/

Parameters:
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with triggers.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
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);

Sample Response



{
 "status": true,
 "code": 200,
 "data": {
 "Main_Account": [
 {
 "account_name": "MyMainAccount",
 "owner_email": "MyMainAccount@marketingplatform.com",
 "status": 1,
 "full_name": "MyMainAccount",
 "phone": 4578xxxxx,
 "user_timezone": "Europe/Talin",
 "create_date": 1595849768
 }
 ],
 "Sub_Accounts": [
 {
 "account_name": "MySubAccount",
 "owner_email": "MySubAccount@marketingplatform.com",
 "status": 1,
 "full_name": "User",
 "phone": "",
 "user_timezone": "Europe/Paris",
 "create_date": 1590144074
 },
 {
 "account_name": "MySubAccount_2",
 "owner_email": "MySubAccount_2@marketingplatform.com",
 "status": 1,
 "full_name": "MySubAccount_2",
 "phone": "",
 "user_timezone": "Europe/Ulm",
 "create_date": 1587020975
 }
 ]
 }
}

{
 "status": false,
 "code": 401,
 "message": "You have attempted to execute a API call with incorrect credentials! Access denied!"
}

Create SubAccount

Create sub account from your admin account.

POST

/Users/SubAccount/

Parameters:
  • String
    account_name



    Set username for your new sub account. MP will automatically add owner username as prefix.
  • String
    account_password



    Set password for your new sub account.
  • String
    email_address



    Set email address for your new sub account.
  • Array
    allowed_domains



    Set which domains will be able to use this sub account. Only domains from main account can be used.
Response:
  • On success:
    HTTP code 201



    Json with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl POST 'https://api.mailmailmail.net/v2.0/Users/SubAccount' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"account_name":"test-account_4","account_password":"password","email_address":"test@localhost.com","allowed_domains":["@localhost.com","@some_dk.com"]}'
{
 "account_name": "test-account_4",
 "account_password": "password",
 "email_address": "test@localhost.com",
 "allowed_domains": ["@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);

Sample Response


{
 "status":true,
 "code":201
 "message":"New sub account created successfully."
}

{
 "status":false,
 "code":400,
 "message":"Parameter ownerEmail is empty."
}

Update SubAccount

Update SubAccount.

PUT

/Users/SubAccount/

Parameters:
  • String
    account_name



    Username for your sub account.
  • Boolean
    status



    New status for sub account.
  • String
    email_address



    New email address for your sub account.
  • String
    account_password



    New password for your sub account.
  • Array
    allowed_domains



    Set which domains will be able to use this sub account. Only domains from main account can be used.
Response:
  • On success:
    HTTP code 200



    JSON object with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Users/SubAccounts' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"account_name":"master_unsername_sub_account3265","status":false}'
{
 "account_name": "master_unsername_sub_account3265",
 "status": false
}
require_once dirname(__FILE__) . "/ApiParser.class.php";

$settings['username'] = "API_USERNAME";
$settings['token'] = "API_TOKEN";
$parser = new ApiParser($settings);

$accountName = "master_unsername_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 = "master_unsername_sub_account3265";
bool status = false; // Active = true; Disabled = false

string result = parser.SetSubAccountStatus(triggerid, status);

Sample Response


{
 "status":true,
 "code":200,
 "data":{
 "message":"Sub account has been updated"
 }
}

{
 "status":false,
 "code":400,
 "message":"Parameter accountName is empty"
}

Get Inherit lists

Get a list of inherit lists.

GET

/Users/InheritLists/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json object with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritLists?account_name=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);

Sample Response


{
 "status": true,
 "code": 200,
 "data": [{
 "listid": 7608,
 "name": "Test_Case_List_Denmark_11815114",
 "description": "Description 1",
 "mobile_prefix": "",
 "sender_name": "Denis Green",
 "sender_email": "some@ownerDK.com",
 "reply_email": "some@ownerDK.com",
 "company_name": "", "mobile_prefix":null
 "company_email": "",
 "company_address": "",
 "company_phone": ""
 }, {
 "listid": 7609,
 "name": "Test_Case_List_Denmark_81059802",
 "description": "Description 2",
 "mobile_prefix": "",
 "sender_name": "Denis Bank",
 "sender_email": "some2@ownerDK.com",
 "reply_email": "some2@ownerDK.com,
 "company_name": "",
 "company_email": "",
 "company_address": "",
 "company_phone": ""
 }]
}

{
 "status": false,
 "code": 401,
 "message": "Specified account is not your sub account."
}

Inherit Lists To SubAccount

Inherit lists from your admin account to sub account.

PUT

/Users/InheritLists/

Parameters:
  • String
    account_name



    Set sub account name that you want to inherit lists.
  • Array
    inherit_lists



    Set lists which need to be inherited.
Response:
  • On success:
    HTTP code 200



    Json with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritLists' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"account_name":"InheritLists_Test","inherit_lists":[234,23452,3123,32]}'
{
 "account_name": "InheritLists_Test",
 "inherit_lists": [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);

Sample Response


{

 "status":true,
 "code":200,
 "message":"Inherit successful."
}

{
 "status":false,
 "code":401,
 "message":"Specified account is not your sub account"
}

Delete Inherit Lists

Delete Inherit Lists for specific sub account

DELETE

/Users/InheritLists/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    listid



    Inherit listid ID that will be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with data fields.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritLists?account_name=InheritLists_Test&listid=12' -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 = "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);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Inherited list has been deleted."
}

{
 "status":false,
 "code":403,
 "message":"This user is not owner of the list"
}

Get Inherit Segments

Get a list of Inherit Segments.

GET

/Users/InheritSegments/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritSegments?account_name=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);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "segmentid":1,
 "segment_name":"Test GetStatidsBySegment",
 "create_date":1580307521,
 "update_date":1580307521,
 "used_lists":[
 9
 ],
 "search_info":{
 "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

Inherit segments to sub account.

PUT

/Users/InheritSegments/

Parameters:
  • String
    account_name



    Set sub account name that you want to inherit segments.
  • Array
    inherit_segments



    Set segments which need to be inherited.
Response:
  • On success:
    HTTP code 200



    Json array with message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritSegments' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"account_name":"InheritSegments_Test","inherit_segments":[23,442,1234]}'
{
 "account_name": "InheritSegments_Test",
 "inherit_segments": [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);

Sample Response


{

 "status":true,
 "code":201,
 "message":"Inherit successful."
}

{
 "status":false,
 "code":400,
 "message":"Parameter accountName is empty."
}

Delete Inherit Segments

Delete Inherited Segment from Specific account

DELETE

/Users/InheritSegments/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    segmentid



    Inherit segment ID that will be deleted.
Response:
  • On success:
    HTTP code 200



    JSON with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritSegments?account_name=InheritSegments_Test&segmentid=12' -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 = "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);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Inherited segment has been deleted."
}

{
 "status":false,
 "code":403,
 "message":"Only inherit segments can be deleted."
}

Get Inherit Newsletters

Get a list of Inherited Newsletters.

GET

/Users/InheritNewsletters/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    limit



    Number of records you want to fetch.
  • Integer
    offset



    Starting point.
Response:
  • On success:
    HTTP code 200



    Json with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl GET 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters?account_name=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);

Sample Response


{
 "status":true,
 "code":200,
 "data":[
 {
 "newsletterid":1,
 "name":"Newsletter name",
 "subject":"Newsletter subject",
 "active":1,
 "create_date":1613119186,
 "update_date":1616410086,
 "selected_lists":[
 6
 ],
 "selected_segments":[
 
 ],
 "url":"https://app.marketingplatform.com/display.php?N=1&T=933c3640325"
 },
 {
 "newsletterid":2,
 "name":"Newsletter name 2",
 "subject":"Newsletter subjects 2",
 "active":1,
 "create_date":1613119194,
 "update_date":1613120415,
 "selected_lists":[
 6
 ],
 "selected_segments":[
 
 ],
 "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

Inherit newsletter to sub account.

PUT

/Users/InheritNewsletters/

Note: You can't inherit newsletter that contains dynamic content or relation fields.
Parameters:
  • String
    account_name



    Set sub account name that you want to inherit newsletter.
  • Integer
    newsletterid



    Newsletter ID that will be inherited.
  • String
    recipients_type



    Choose recipients type. Available options "list" and "segment".
  • Array
    recipeintsid



    Specify list or segment ids you want to be recipients with inherited newsletter.
Response:
  • On success:
    HTTP code 200



    Json with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl PUT 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters' -H 'Apiusername: API_USERNAME' -H 'Apitoken: API_TOKEN' -H 'Content-Type: application/json' -d '{"account_name":"InheritNewsletter_Test","newsletterid":123,"recipients_type":"segment","recipeintsid":[23,55,23,5232]}'
{
 "account_name": "InheritNewsletter_Test",
 "newsletterid": 123,
 "recipients_type": "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);

Sample Response


{

 "status":true,
 "code":201,
 "message":"Inherit successful."
}

{
 "status":false,
 "code":401,
 "message":"Specified account is not your sub account"
}

Delete Inherit Newsletter

Delete Inherited Newsletter from Specific Sub Account

DELETE

/Users/InheritNewsletters/

Parameters:
  • String
    account_name



    Sub account name.
  • Integer
    newsletterid



    Inherit newsletter ID that will be deleted.
Response:
  • On success:
    HTTP code 200



    JSON object with success message.
  • On failure:
    HTTP code 4xx, 5xx



    Error message describing the reason for the failure.
curl DELETE 'https://api.mailmailmail.net/v2.0/Users/InheritNewsletters?account_name=InheritNewsletter_Test&newsletterid=15 -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 = "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);

Sample Response


{
 "status":true,
 "code":200,
 "message":"Inherited campaign has been deleted."
}

{
 "status":false,
 "code":400,
 "message":"Missing required parameter."
}
version 2.0.1