By far the easiest way to install the api-client is to require it with Composer.
$ composer require "planviewer/api-client-php:^1.0.0"
{
"require": {
"planviewer/api-client-php": "^1.0.0"
}
}
If you're not familiar with using composer we've added a ZIP file to the releases containing the API client. Download the api-client-php from the releases page.
You'll need a Client & Secret in order to use Planviewer API's Log into https://www.planviewer.nl and go to your applications: https://www.planviewer.nl/my_api/applications/
Generate a random Client & Secret.
Add the Client & Secret to /config/config.php or to your configuration file.
return [
'api-key' => '86c****7b',
'api-secret' => '3783******6b3ab4c87fef3ffc*****bb058a72c****cbef2d',
];
Add the use to your class or script. create an instance of the Planviewer object.
use Planviewer/Planviewer;
$planviewer = new Planviewer($config);
The Planviewer object contains all our API's. You can access the calls as follows:
/** Access Maps API */
$planviewer->mapsApi>listViewers();
/** Access Data API */
$planviewer->dataApi->getdataList();
/** Access Product API */
$planviewer->productApi->getProducts();