The PHP library depends on PHP 5.5 or higher.
If you're using Composer, you can simply add a dependency droath/webmerge
to your project's composer.json file.
{
"require": {
"droath/webmerge": "dev-master"
}
}
Set the WebMerge API key and secret, which are defined within your WebMerge Account.
<?php
$config = new \WebMerge\Config(
'3K83KMN1AL6M1MXMVVCKR66BP9NA', 'I51BBZ5R'
);
$resource = new \WebMerge\Resource($config, '\WebMerge\Resources\Document');
Retrieve a WebMerge resource document by ID.
<?php
...
$resource = new \WebMerge\Resource($config, '\WebMerge\Resources\Document');
$response = null;
try {
$response = $resource(123456)->get();
} catch (Exception $e) {
// error handling
}
$data = $response->extract()->asArray();
var_dump($data);