Commencer un nouveau sujet

PHP | Scheduling API: how to get a list of all appointments for the rest of the year

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


Connexion ou Inscription pour poster un commentaire