PHP | How to get a list of all appointments for the rest of the year

Publié sur un an il y a par  Julien Pauthier

Publier un sujet
Julien Pauthier
Julien Pauthier Administrateur

You can extract all upcoming appointments of the year, along with a link to the appointment pages in the backoffice (useful if you need to update or reassign a list of appointments to a specific staff):


<?php
$apiKey = "";
$ssoToken = "";
$company = "";

$startDate = date("Y-m-d\T00:00:00P", strtotime('now'));
$endDate = date("Y-m-d\T23:59:59P", strtotime('31 December 2020'));

$data = file_get_contents("https://api.agendize.com/api/2.1/scheduling/companies/$company/appointments?startDate=$startDate&endDate=$endDate&apiKey=$apiKey&token=$ssoToken");
$clients = json_decode($data);

echo "Client\tDate\tLink in Agendize backoffice\n";
foreach ($clients->items as $rdv) {
echo substr($rdv->client->firstName, 0, 1) . ". " . substr($rdv->client->lastName, 0, 1) . ".\t";
echo $rdv->start->dateTime . "\t";
echo "https://app.agendize.com/console/scheduling/view-event.jsp?id=" . $rdv->id . "\n";
}
?>


0 Votes


0 Commentaires

Connexion ou S'inscrire pour poster un commentaire