2
0

onboarding_test.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. $url = "https://webdev.services.vision4it.de/kunden/xtend2/onboarding_mail.php";
  3. // The data to send to the API
  4. $postData = json_decode('{
  5. "ignite": [
  6. "other",
  7. "telefon"
  8. ],
  9. "startdatum": "2024-07-31",
  10. "employeeType": "Agent",
  11. "position": "Service Specialist",
  12. "mykene": "ja",
  13. "ap": "Stefanie Uhler",
  14. "areamanager": "Guido Baumeister",
  15. "name": {
  16. "vorname": "Andreas",
  17. "nachname": "Schiefer"
  18. },
  19. "kuerzel": "ASC",
  20. "benutzername": "ASCHI",
  21. "email": "andreas.schiefer@xtend.de",
  22. "anrede": "Herr",
  23. "durchwahl": 1234,
  24. "agentengruppen": [
  25. "Aushilfe"
  26. ],
  27. "abteilung": "EDV",
  28. "ms365lizenz": "Basic",
  29. "infos": "Info 1\nInfo 2"
  30. }');
  31. // Setup cURL
  32. $ch = curl_init($url);
  33. curl_setopt_array($ch, array(
  34. CURLOPT_POST => TRUE,
  35. CURLOPT_RETURNTRANSFER => TRUE,
  36. CURLOPT_HTTPHEADER => array(
  37. 'Content-Type: application/json;charset=UTF-8'
  38. ),
  39. CURLOPT_POSTFIELDS => json_encode($postData)
  40. ));
  41. // Send the request
  42. $response = curl_exec($ch);
  43. // Check for errors
  44. if($response === FALSE){
  45. die(curl_error($ch));
  46. }
  47. // Decode the response
  48. $responseData = json_decode($response, TRUE);
  49. // Close the cURL handler
  50. curl_close($ch);
  51. // Print the date from the response
  52. var_dump($responseData);
  53. ?>