"MISSING_PARAMETERS", "message" => "sn and version_id required"]); exit; } // Generate token $token = create_download_url_token($criterias['sn'], $criterias['version_id']); $download_url = "https://" . $_SERVER['SERVER_NAME'] . "/api.php/v2/get/software_download?token=" . $token; // Return token and download URL echo json_encode([ "success" => true, "token" => $token, "download_url" => $download_url, "expires_in_seconds" => 900, "serial_number" => $criterias['sn'], "version_id" => $criterias['version_id'] ]); ?>