droath/webmerge

WebMerge.me REST API resources.

v1.1 2016-04-03 21:52 UTC

README

Requirements

The PHP library depends on PHP 5.5 or higher.

Installation

Composer

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"
    }
}

Usage

Configuration

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');

Get 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);

Sponsored By

Isovera Logo