PHP-Beispielcode

<?php

  // Url of the service
  $url = 'https://api.adresslabor.de/v1/de/check';

  $fields = array(
    'product'      => 'EMX,SC,FK,PB,NC',
    'firstname'    => 'Max',
    'lastname'     => 'Mustermann',
    'street'       => 'Teststr.',
    'hno'          => '9',
    'zip'          => '12345',
    'city'         => 'Entenhausen',
    'country'      => 'DE',
    'phone'        => '01234/56789',
    'email'        => 'test@test-email.de',
    'apicid'       => 1,
    'apikey'       => 'ffffffff-ffff-ffff-ffff-ffffffffffff'
  );

  //Open connection.
  $ch = curl_init();

  // Set the right curl-options.
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  //Execute post and close connection.
  $result = curl_exec($ch);
  curl_close($ch);
  
  // Decode json-data
  $result = json_decode($result);
  
  // Access the complete result.
  print_r($result)
 
  // Access the email-check-result.
  print_r($result -> em);
 
  // Access the email-resulttext.
  print_r($result -> em -> resulttext);
   
?>