PHP | How to get a list of all contacts from your CRM

Publié environ 1 an il y a par  Julien Pauthier

Publier un sujet
Julien Pauthier
Julien Pauthier Administrateur

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";
}
?>



0 Votes


0 Commentaires

Connexion ou S'inscrire pour poster un commentaire