offboarding_test.php 907 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. $url = "https://webdev.services.vision4it.de/kunden/xtend2/offboarding_mail.php";
  3. // The data to send to the API
  4. $postData = json_decode('{
  5. "enddatum": "2024-07-31",
  6. "ap": "Stefanie Uhler",
  7. "anrede": "Herr",
  8. "name": {
  9. "vorname": "Andreas",
  10. "nachname": "Schiefer"
  11. },
  12. "infos": "Info 1\nInfo 2"
  13. }');
  14. // Setup cURL
  15. $ch = curl_init($url);
  16. curl_setopt_array($ch, array(
  17. CURLOPT_POST => TRUE,
  18. CURLOPT_RETURNTRANSFER => TRUE,
  19. CURLOPT_HTTPHEADER => array(
  20. 'Content-Type: application/json;charset=UTF-8'
  21. ),
  22. CURLOPT_POSTFIELDS => json_encode($postData)
  23. ));
  24. // Send the request
  25. $response = curl_exec($ch);
  26. // Check for errors
  27. if($response === FALSE){
  28. die(curl_error($ch));
  29. }
  30. // Decode the response
  31. $responseData = json_decode($response, TRUE);
  32. // Close the cURL handler
  33. curl_close($ch);
  34. // Print the date from the response
  35. var_dump($responseData);
  36. ?>