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

Direct HTTP/REST API

Arguments

Parameters passed by post:

Returns

JSON encoded structure with 8 characters prefix = "UDDS[OK]:". Another prefix value means communication problems.

Example


  $requestPOST = array();
  $requestPOST [ 'customerCode' ] = '[your_customerCode]' ;
  $requestPOST [ 'login' ] = '[your_login]' ;
  $requestPOST [ 'password' ] = '[your_password]' ;
  
  $params = array();
  $params [ 'searchParams' ] = array();
  $params [ 'commandName' ] = 'test' ;
  $params [ 'functionParams' ] = array() ;
  $params [ 'clientInfo' ] = array (
    "version" => "1.0.0.0",
    "serverName" => "192.168.7.22",
    "hostName" => "192.168.7.22",
    "serverAddr" => "192.168.7.22",
    "remoteAddr" => "192.168.7.102",
    "httpUserAgent" => "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/71.0.3578.98 Safari\/537.36"  
  );  
  
  $requestPOST [ 'params' ] = json_encode ( $params ) ;

  
  $c = curl_init ( [server_url] ) ;  
  curl_setopt( $c, CURLOPT_POST, true) ;
  curl_setopt( $c, CURLOPT_POSTFIELDS, $requestPOST ) ;
  curl_setopt( $c, CURLOPT_ENCODING, 'gzip');
  curl_setopt( $c, CURLOPT_CONNECTTIMEOUT, 30 );
  curl_setopt( $c, CURLOPT_TIMEOUT, 30 );
  curl_setopt( $c, CURLOPT_RETURNTRANSFER, true);
  curl_setopt( $c, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt( $c, CURLOPT_HTTPHEADER, array('Expect:'));
  $res = curl_exec( $c );


Returns $ret = UDDS[OK]:{"serverInfo":{"version":"1.3.0.0","debugInfo":{"timers":{"classUddsServer.get":3.6001205444336e-5}},"sqlInfo":{"queryCounter":17,"queryLog":[]}},"error":{"id":null,"info":null},"answer":{"test":"OK"}}