Autopilot Create List API using PHP
$value = "@/tmp/test_file.csv";
if ((version_compare(PHP_VERSION, '5.5') >= 0))
$value = curl_file_create("/tmp/test_file.csv"); #<== For PHP 5.5+ ONLY
$list_name = "UK_MyList";
$location = "DE"; # <== Optional. Without it the list will be "taged" as ALL
$url = "https://api.doctor-mailer.com/autopilot_create_list";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
if ((version_compare(PHP_VERSION, '5.5') >= 0))
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); #<== For PHP 5.5+ ONLY
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"list_name" => $list_name,
"location" => $location,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
File Accepted- File accepted for checking.
{"Results":{"status":"Success","name":"UK_MyList_1","load_id":"QTExNjJJMzAq"}}
Error- There was a problem with the file.
{"Results":{"status" => "Error:Invalid file"}}
Autopilot Get Load List Status API using PHP
$value = "QTExNjJJMzAq";
$url = "https://api.doctor-mailer.com/autopilot_load_list_status";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
Load ID Found
{"QTExNjJJMzAq":{"status":"done"}}
Error- There was a problem with the load id.
{"QTExNjJJMzAq":{"status":"Error:Can't check load status for QTExNjJJMzAq"}}
Autopilot Delete List API using PHP
$value = "UK_MyList";
$url = "https://api.doctor-mailer.com/autopilot_delete_list";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Unsubscribe From All Lists API using PHP
$value = "from@domain.com";
$url = "https://api.doctor-mailer.com/autopilot_unsubscribe_all";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Resubscribe To All Lists API using PHP
$value = "from@domain.com";
$url = "https://api.doctor-mailer.com/autopilot_resubscribe_all";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get List API using PHP
$value = "UK_MyList";
$search = ""; <== Optional
$records_start = 0; <== Optional
$page_size = 10; <== Optional
$url = "https://api.doctor-mailer.com/autopilot_get_list";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'search' => $search,
'records_start' => $records_start,
'page_size' => $page_size,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Lists API using PHP
$url = "https://api.doctor-mailer.com/autopilot_get_lists";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Lists Per Location API using PHP
$value = "UK"; # We can also send "search" in order to get a specific one
$url = "https://api.doctor-mailer.com/autopilot_get_lists_per_location";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get List Stats API using PHP
$value = "UK_MyList";
$url = "https://api.doctor-mailer.com/autopilot_get_list_stats";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Register Webform Lead API using PHP
$value = "from@domain.com";
$formid=1;
$personalizations = json_encode(array('first_name' => 'Dave','last_name' => 'Grohl'));
$url = "https://api.doctor-mailer.com/autopilot_register_webform_lead";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"formid" => $formid,
"personalizations" => $personalizations,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Create Creative API using PHP
$creative_name = "MyCreative";
$location = "ENG"; # <== Optional. Without it the creative will be taged as ALL
$subject = "My Subject";
$from_name = "Info";
$from_address = "info@{{hd}}"; #<== Use {{hd}} as the real sender domain
$replyto_name = "Info";
$replyto_address = "info@{{hd}}"; #<== Use {{hd}} as the real sender domain
$content = "<div style='font-family:tahoma,sans-serif;color:#073763'>Test Body</div>";
$content_text = ""; # <== Optional. Use it if you like to send a "multipart" creative
$extra_link_params = ""; # <== Optional. Use it if you like to set dynamic params to your links
$url = "https://api.doctor-mailer.com/autopilot_create_creative";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"creative_name" => $creative_name,
"subject" => $subject,
"from_name" => $from_name,
"from_address" => $from_address,
"replyto_name" => $replyto_name,
"replyto_address" => $replyto_address,
"content" => $content,
"content_text" => $content_text,
"location" => $location,
"extra_link_params" => $extra_link_params,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Delete Creative API using PHP
$value = "ENG_MyCreative";
$url = "https://api.doctor-mailer.com/autopilot_delete_creative";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Creatives API using PHP
$url = "https://api.doctor-mailer.com/autopilot_get_creatives";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Creatives Per Location API using PHP
$value = "UK"; # We can also send "search" in order to get a specific one
$url = "https://api.doctor-mailer.com/autopilot_get_creatives_per_location";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Creative API using PHP
$value = "ENG_MyCreative"; # <== Creative Name
$url = "https://api.doctor-mailer.com/autopilot_get_creative";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Tunnels API using PHP
$url = "https://api.doctor-mailer.com/autopilot_get_tunnels";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Top Tunnels Per Location API using PHP
$value = "UK"; # <== Location in 2 charactes
$url = "https://api.doctor-mailer.com/autopilot_get_top_tunnels_per_location";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Tunnel Speed API using PHP
$tunnel_id = "1";
$url = "https://api.doctor-mailer.com/autopilot_get_tunnel_speed";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'tunnel_id' => $tunnel_id,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Send Campaign API using PHP
$tunnel_id="1";
$list_name="UK_TestList";
$creative_name="UK_TestCreative";
$throttle_per_hour=1000;
$segment = 1; #<== Optional (1==ALL,2==Viewed,3==Clicked)
$mailing_name = "TestCampaign"; #<== Optional
$sched_datetime = ""; #<== Optional (default "" == now)
$url = "https://api.doctor-mailer.com/autopilot_send_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'tunnel_id' => $tunnel_id,
'list_name' => $list_name,
'creative_name' => $creative_name,
'throttle_per_hour' => $throttle_per_hour,
'segment' => $segment,
'mailing_name' = $mailing_name,
'sched_datetime' => $sched_datetime,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Send Oneoff API using PHP
$value="to@domain.com";
$tunnel_id="1";
$creative_name="UK_TestCreative";
$tracking_url="https://my-tracking.domain.com/tracking-script";
$personalizations=json_encode(array('first_name' => 'Dave','last_name' => 'Grohl'));
$url = "https://api.doctor-mailer.com/autopilot_send_one_off_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'tunnel_id' => $tunnel_id,
'creative_name' => $creative_name,
'tracking_url' = $tracking_url,
'personalizations' => $personalizations,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"to@domain.com":"559f80fb192f6a6b4bd253b94334202e"}
Error Occurred:
{"ERROR":"Not a valid API key"}
Autopilot Get History Campaigns API using PHP
# We can send "search" (default:""), "records_start" (default:0), "page_size" (default:10)
$url = "https://api.doctor-mailer.com/autopilot_get_history_campaigns";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Autopilot Get Current Campaigns API using PHP
$url = "https://api.doctor-mailer.com/autopilot_get_current_campaigns";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"Results":{"67088":1,"67507":1}}
Error Occurred:
{"Results":-1}
Autopilot Get Success Rate Per Campaign API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_get_success_rate_per_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":80.595930232558}
Error Occurred:
{"1":-1}
Autopilot Get Campaign Stats API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_get_campaign_stats";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":{"sent":13022,"success":13005,"viewed":417,"clicked":140,"unsubscribed":0}}
Error Occurred:
{"1":-1}
Autopilot delete Campaign API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_delete_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":1}
Error Occurred:
{"1":-1}
Autopilot Cancel Campaign API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_cancel_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":1}
Error Occurred:
{"1":-1}
Autopilot Pause Campaign API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_pause_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":1}
Error Occurred:
{"1":-1}
Autopilot Resume Campaign API using PHP
$value = "1"; # <== CampaignID
$url = "https://api.doctor-mailer.com/autopilot_resume_campaign";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"1":1}
Error Occurred:
{"1":-1}
Mail Lab Pro API using PHP
$to = "@doctor-mailer.com"; # <== This is your seed - you don't have to touch it
$from_name = "John Doe";
$from_address = "from@domain.com";
$ip = "1.2.3.4";
$subject = "Your Subject Line";
$message_id = "UNIQUE ID"; # <== Optional
$value = "<div style='font-family:tahoma,sans-serif;color:#073763'>Test Body</div>";
$url = "https://api.doctor-mailer.com/mail_lab_check";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'to' => $to,
'from_name' => $from_name,
'from_address' => $from_address,
'ip' => $ip,
'subject' => $subject,
'message_id' => $message_id,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
No Errors:
{"c4ac1a0a57cc558700c0dd69f50540d3":{"Tunnel":"Unknown","Domain RBLs":"none","IP RBLs":"","Spamhaus":"","Spamhaus Domain":"none","Return Path":"Clean","Trusted Source":"Clean","Avira":"Clean","ESET":"Clean","BitDefender":"Clean","Commtouch":"0","Cloudmark Fuz":"0","DCC":"0","Cloudmark Razor":"0","Google":"0","McAfee":"0","AVG":"0","SpamAssassin":{"score":"6.2","419":"0","rules":"HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,INVALID_MSGID,MIME_HTML_ONLY,MSGID_NOFQDN1,NO_RELAYS,TO_NO_BRKTS_HTML_ONLY"}}}
Error Occurred:
{"c4ac1a0a57cc558700c0dd69f50540d3":{"error":"unknown error"}}
Leads Surgeon Email Check using PHP
$value = "from@domain.com";
$url = "https://api.doctor-mailer.com/leads_surgeon_check";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
Good Email- Email which can be used.
{"from@domain.com":0}
Bad Email- Email which should be suppressed.
{"from@domain.com":1}
Leads Surgeon File - Submit using PHP
$value = "@/tmp/test_file.txt";
if ((version_compare(PHP_VERSION, '5.5') >= 0))
$value = curl_file_create("/tmp/test_file.csv"); #<== For PHP 5.5+ ONLY
$url = "https://api.doctor-mailer.com/leads_surgeon_file_check";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
if ((version_compare(PHP_VERSION, '5.5') >= 0))
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); #<== For PHP 5.5+ ONLY
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
File Accepted- File accepted for checking.
{"Results":{"status":"Success","id":"QTExNjJJMzAq"}}
Error- There was a problem with the file.
{"Results":{"status" => "Error:Invalid file"}}
Leads Surgeon File - Check Status using PHP
$value = "QTExNjJJMzAq";
$url = "https://api.doctor-mailer.com/leads_surgeon_file_status";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
{"QTExNjJJMzAq":{"total":2000,"done_percent":100,"good":1000,"bad":1000}}
Leads Surgeon File - Get Results using PHP
$value = "QTExNjJJMzAq";
$url = "https://api.doctor-mailer.com/leads_surgeon_file_results";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
if (strpos($response, '"ERROR":'))
echo $response;
else
file_put_contents("/tmp/$value.zip", $response);
curl_close($ch);
Example of response:
Results are ready
A zip file content
Error- The file is still in process.
{"QTExNjJJMzAq":{"ERROR":"Still in process"}}
Leads Surgeon File - Upload using PHP
$value = "QTExNjJJMzAq";
$list_name = "test_20170601";
$location = "DE";
$url = "https://api.doctor-mailer.com/leads_surgeon_file_upload";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'list_name' => $list_name,
'location' => $location,
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
{"QTExNjJJMzAq":1}
Health Monitor API using PHP
$value = "1.2.3.4";
$url = "https://api.doctor-mailer.com/health_monitor_check";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
{"1.2.3.4":{"Return Path":"20","Trusted Source":"Clean","IP RBLs":"Clean","Domain RBLs":"Clean","Spamhaus":"Clean","Spamhaus Domain":"[dbl.spamhaus.org]"}}
OR{"domain.com":{"Mcafee":"Spam URLs","AVG":"Clean","Google":"Clean","IP RBLs":"Clean","Domain RBLs":"Clean","Spamhaus":"[zen.spamhaus.org][sbl-xbl.spamhaus.org]","Spamhaus Domain":"[dbl.spamhaus.org]"}}
Health Monitor Add IP API using PHP
$value = "1.2.3.4";
$tunnel = "Tunnel#1"; # <== Optional
$url = "https://api.doctor-mailer.com/health_monitor_add";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"tunnel" = $tunnel; # <== Optional
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
OK- IP was added.
{"1.2.3.4":0}
Error- You might have exceded your limit.
{"1.2.3.4":1}
Health Monitor Delete IP API using PHP
$value = "1.2.3.4";
$url = "https://api.doctor-mailer.com/health_monitor_del";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
{"1.2.3.4":0}
Usage API using PHP
$value = "201706"; # <== date (Ym [year and month])
$url = "https://api.doctor-mailer.com/api_usage";
$key = "PUT YOUR API KEY HERE";
$secret = "[CALL US IN ORDER TO GET IT]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"value" => $value,
"secret" => $secret) );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"authorization: Bearer $key"
));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Example of response:
{"201706":"1500"}