0

I would like to work with this api: https://www.etermin.net/api/index.html#api-Calendar-Get

For this I API part I have the following code:

$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, 'https://www.etermin.net/api/calendar?ublickey='.$publicKey.'&salt='.$salt.'&signature='.$encodedSignature.'');
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);

This code works fine !

Now I would like to create a appointment with this api: https://www.etermin.net/api/index.html#api-Appointment-Create

Now I need a post request solution and I tried this:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.etermin.net/api/appointment");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
    'publickey'     =>  $publicKey,
    'salt'          =>  $salt,
    'signature'     =>  $encodedSignature,
    'start'         =>  '2021-04-28%2018:00',
    'end'           =>  '2021-04-28%2019:00',
    'calendarid'    =>  '90650',
    'firstname'     =>  'Max',
    'lastname'      =>  'Mustermann'
)));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close ($ch);


echo '<pre>';
var_dump($server_output);
echo '</pre>';

I get the response:

string(11) "Bad Request"

I need help! :(

Ghost108
  • 3,277
  • 8
  • 37
  • 79

0 Answers0