UDDS OX API - documentation ver.2.5 (2023-04-07) ( www.dlaoperatora.pl )

Function ping

Description

Health check for external KSeF Service. Checks if the service is running and returns its version and log.

Important notes

Arguments

None - this function takes no parameters.

Returns

Success response

{
  "status": "OK",
  "version": "1.0.0.0",
  "log": "12:30:45 Server started\n12:30:46 KSeF initialized",
  "message": null
}

Error response

{
  "status": "ERROR",
  "version": null,
  "log": null,
  "message": "Nie można połączyć z serwisem KSeF",
  "curlError": "Connection refused",
  "curlErrno": 7
}

Possible error messages

Example

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'];
}

Related endpoints