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
use Pitwch\RestAPIWrapperProffix\Client;
// Minimale Initialisierung — options ist optional und kann weggelassen werden
$pxrest = new Client(
'https://myserver.ch:999', // URL ohne /pxapi/V4/
'DEMO', // Datenbankname
'USR', // Benutzername
'b62cce2fe18f7a156a9c719c57bebf0478a3d50f0d7bd18d9e8a40be2e663017', // SHA256-Passwort
'ADR,STU' // Benötigte Module (kommagetrennt)
// options: weggelassen = alle Defaults aktiv
);
// Login passiert automatisch beim ersten Request
$adressen = $pxrest->get('ADR/Adresse', ['limit' => 5]);
print_r($adressen);
$listeNr = 1029; // ListeNr aus PROFFIX
$pdfResponse = $pxrest->getList($listeNr);
if ($pdfResponse->getCode() === 200) {
file_put_contents('Adressliste.pdf', $pdfResponse->getBody());
}
// Mit API-Key direkt
$info = $pxrest->info('112a5a90fe28b23ed2c776562a7d1043957b5b79fad242b10141254b4de59028');
// API-Key aus options['key'] verwenden
$info = $pxrest->info();