PHP code example of pitwch / rest-api-wrapper-proffix-php
1. Go to this page and download the library: Download pitwch/rest-api-wrapper-proffix-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pitwch / rest-api-wrapper-proffix-php example snippets
composer
use Pitwch\RestAPIWrapperProffix\Client;
use Pitwch\RestAPIWrapperProffix\Client;
$pxrest = new Client(
'https://myserver.ch:999',
'DEMO',
'USR',
'b62cce2fe18f7a156a9c719c57bebf0478a3d50f0d7bd18d9e8a40be2e663017',
'ADR,STU',
array('key'=>'112a5a90fe28b23ed2c776562a7d1043957b5b79fad242b10141254b4de59028','limit'=>2));
$adressen = $pxrest->get('ADR/Adresse',array('filter'=>'GeaendertAm>d\'2018-05-17 14:54:56\'','depth'=>1,'fields'=>'AdressNr,Name,GeaendertAm'));;
print_r($adressen);
//Escape ' with \'
array('filter'=>'GeaendertAm>d\'2018-05-17 14:54:56\'','depth'=>1,'fields'=>'AdressNr,Name,GeaendertAm')
//Einfache Abfrage
$pxrest = new Client(...)
$adresse = $pxrest->get("ADR/Adresse/1") //Legt Response als Objects in $adresse ab
$adresse->Name //DEMO AG
/Abfrage mit Parametern
$pxrest = new Client(...)
$adresse = $pxrest->get("ADR/Adresse",array('filter'=>'GeaendertAm>d\'2018-05-17 14:54:56\'','depth'=>1,'fields'=>'AdressNr,Name,GeaendertAm','limit'=>5))
$pxrest = new Client(...)
$data = array("AdressNr"=>1,"Ort"=>"Zürich","PLZ"=>8000,"EMail"=>"[email protected]");
$adresse = $pxrest->put("ADR/Adresse",$data) //Sendet $data an Endpunkt ADR/Adresse
$pxrest = new Client(...)
$data = array("AdressNr"=>1,"Ort"=>"Zürich","PLZ"=>8000,"EMail"=>"[email protected]");
$adresse = $pxrest->post("ADR/Adresse",$data) //Sendet $data an Endpunkt ADR/Adresse
$pxrest = new Client(...)
$adresse = $pxrest->get("ADR/Adresse")
//Zusatzinformationen zum letzten Request
$lastRequest = $pxrest->http->getRequest();
$lastRequest->getUrl(); // Get requested URL (string).
$lastRequest->getMethod(); // Get request method (string).
$lastRequest->getParameters(); // Get request parameters (array).
$lastRequest->getHeaders(); // Get request headers (array).
$lastRequest->getBody(); // Get request body (JSON).
//Zusatzinformationen zur letzten Response
$lastResponse = $pxrest->http->getResponse();
$lastResponse->getCode(); // Response code (int).
$lastResponse->getHeaders(); // Response headers (array).
$lastResponse->getBody(); // Response body (JSON).
$pxrest = new Client(...)
//Variante 1: API - Key direkt mitgeben
$info1 = $pxrest->info('112a5a90fe28b23ed2c776562a7d1043957b5b79fad242b10141254b4de59028');
//Variante 2: API - Key aus Options verwenden (sofern dort hinterlegt)
$info2 = $pxrest->info();
$pxrest = new Client(...);
//Variante 1: API - Key direkt mitgeben
$datenbank1 = $pxrest->database('112a5a90fe28b23ed2c776562a7d1043957b5b79fad242b10141254b4de59028');
//Variante 2: API - Key aus Options verwenden (sofern dort hinterlegt)
$datenbank2 = $pxrest->database();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.