Get POST and FILES into an array then json

  $DebugCapture = array();
  $DebugCapture['POST'] = $_POST;
  $DebugCapture['FILES'] = $_FILES;
  $DebugCapture = json_encode($DebugCapture, (JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

Write json POST to a file in API handler so you can view it

  //Retrieve the raw POST data
  $JsonData = file_get_contents('php://input');

  //Write to a debug file
  //file_put_contents("debugtemp/myapidebugfile.txt", PHP_EOL . PHP_EOL . $JsonData, FILE_APPEND | LOCK_EX);			//(Create or append if exists))

  $DecodedJson = json_decode($JsonData, True);
  if (!is_null($DecodedJson))
  {
    //Write to a debug file
    file_put_contents("debugtemp/myapidebugfile_json.txt", PHP_EOL . PHP_EOL . print_r($DecodedJson, true), FILE_APPEND | LOCK_EX);			//(Create or append if exists))

  }