title: PHP: How to capture data from Livehealth Webhook API
body: <p>You need to place this code first in your end file (which you shared with the live health API team.)
  They will enable access to this file and once any report will submit, data will be sent on endfile.
  you need to place this below code in that file and you will get a file created in the same root and will see data received from live health API.</p>
  <pre><code>if ($_SERVER['REQUEST_METHOD'] == 'POST') {
      // fetch RAW input
      $json = file_get_contents('php://input');
  
      // decode json
      $object = json_decode($json,true);
  
      // expecting valid json
      if (json_last_error() !== JSON_ERROR_NONE) {
          die(header('HTTP/1.0 415 Unsupported Media Type'));
      }
       
      $time = time();
      $fname ='_callback.test.txt'; 
      file_put_contents($time.$fname , print_r($object, true));
  
      $jdonFile = time().'_json_callback.test.txt';
      $filename = $jdonFile;
      $handle = fopen($filename, &quot;w&quot;);
      fwrite($handle, $json);
      fclose($handle);
  
  }
  </code></pre>