Health check for external KSeF Service. Checks if the service is running and returns its version and log.
KsefService configuration in userDBConfig:
$tc['api']['KsefService'] = [
'serverUrl' => 'http://localhost:8080',
'apiKey' => 'your-api-key',
];
None - this function takes no parameters.
{
"status": "OK",
"version": "1.0.0.0",
"log": "12:30:45 Server started\n12:30:46 KSeF initialized",
"message": null
}
{
"status": "ERROR",
"version": null,
"log": null,
"message": "Nie można połączyć z serwisem KSeF",
"curlError": "Connection refused",
"curlErrno": 7
}
require_once('classUddsOx.php');
$udds = new classUddsOx;
$udds->customerCode = [your_customerCode];
$udds->login = [your_login];
$udds->password = [your_password];
$udds->serverUrl = 'http://api.dlaoperatora.pl/udds/';
$ret = $udds->ping();
if ($ret['status'] == 'OK') {
echo "KSeF Service version: " . $ret['version'];
echo "Service is running correctly";
} else {
echo "Error: " . $ret['message'];
}