Commencer un nouveau sujet

PHP | Contact API: how to get a list of all contact of your CRM

You can extract a list of clients, separated as tabs (TSV) or coma (CSV):


<?php 
$apiKey = "";
$ssoToken = "";
$data = file_get_contents("https://api.agendize.com/api/2.0/clients?apiKey=$apiKey&token=$ssoToken");
$clients = json_decode($data);

echo "Firstname\tLastname\tEmail\tPhone\tAddress\tTags\n";
foreach ($clients->items as $client) {
    echo $client->firstName . "\t" . $client->lastName . "\t" . $client->emailAddresses[0]->email . "\t" . $client->phoneNumbers[0]->number . "\t" . $client->address->street . " " . $client->address->zipCode . " " . $client->address->city . " " . $client->address->country . "\t";
    if (is_array($client->tags))
    foreach ($client->tags as $key => $tagItem) {
        echo $tagItem->tag . "\n";
    }
    echo "\n";
}
?>



Connexion ou Inscription pour poster un commentaire