API
Suppression de contacts :
URL: https://www.ardary-sms.com:3000/api/deleteContact
PHP Example
Customer:
$phonenumber[] = array("phonenumber"=> "PHONE_NUMBER_1" ); $phonenumber[] = array("phonenumber"=> "MPHONE_NUMBER_2" ); $json = array('header'=>array( 'login'=>'YOUR_LOGIN', 'accessKey'=>'YOUR_ACCESSKEY' ), 'contacts'=>$phonenumber ); $str_data = json_encode($json);
Contact delete function
function sendPostData($url, $post){ $ch = curl_init($url); $headers= array('Accept: application/json','Content-Type: application/json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS,$post); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 'false'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if(curl_errno($ch)){ echo 'Curl error: ' . curl_error($ch); } curl_close($ch); return $result; }
Example of answers
In case Of success
{ "data":{ s "res":"done", "elem":["ID_OBJECT"] } }
In case Of error
{ "data":{ "res":"not found" } }