Commencer un nouveau sujet

PHP | Scheduling API: how to create an appointment watcher

You can use this snippet to create a watcher (or webhook) that will send the JSON structure of each new appointment booked:

$apiKey = "";
$token = "";
$companyId = "";

//create a new cURL resource
$ch = curl_init("$companyId/appointments/watch?apiKey=$apiKey&token=$token");

//setup request to send json via POST
$data = array(
    'address' => ""
$payload = json_encode($data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

//set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));

//execute the POST request
$result = curl_exec($ch);

//close cURL resource

Connexion ou Inscription pour poster un commentaire