<?php
$curl = curl_init("https://api.avosms.com/v1/contact/list/information");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
$postfields = array(
'id' => "{ID}", //REQUIRED
'key' => "{KEY}", //REQUIRED
'listContactId' => "{LIST CONTACT ID}", //REQUIRED
);
$postfields_json = json_encode($postfields);
$trame = http_build_query($postfields, '', '&');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $trame);
$raw_response = curl_exec($curl);
curl_close($curl);
$response = json_decode($raw_response);
$status_response = $response->status;
$code = $response->code;
if($code == "OK")
{
$listContactName = $response->list_contact_name;
$listContactCountryName = $response->list_contact_country_name;
$listContactCountryCode = $response->list_contact_country_code;
$nbContactList = $response->nb_contact_list;
$listContactCreationDate = $response->list_contact_creation_date;
$contactList = $response->list_contact;
foreach($contactList as $contact_list)
{
$contactCivility = $contact_list->contact_civility;
$contactName = $contact_list->contact_name;
$contactFirstName = $contact_list->contact_first_name;
$contactTelephoneNumber = $contact_list->contact_telephone_number;
$contactEmail = $contact_list->contact_email;
$contactBirthday = $contact_list->contact_birthday;
$contactOther = $contact_list->contact_other;
}
}
?>