Calendly api {"title":"Resource Not Found","message":"The server could not find the requested resource."}

Viewed 25

I am wanting to create a single use link on calendly and I get {"title":"Resource Not Found","message":"The server could not find the requested resource."} ... I am not sure how to fix this code so that it create a single use link.

<?php
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.calendly.com/scheduling_links",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"max_event_count\": 1,\n  \"owner\":           \"https://api.calendly.com/event_types/012345678901234567890\",\n  \"owner_type\": \"EventType\"\n}",
  CURLOPT_HTTPHEADER => [
    "Authorization: bearer [api key goes here]",
    "Content-Type: application/json"
  ],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
0 Answers
Related