16/03
2017
dev-master
9999999-devLivespace API client
The Requires
- ext-curl *
- ext-json *
- php ^5.3 || ^7.0
Wallogit.com
2017 © Pedro Peláez
Livespace API client
Requires PHP 5.3., (*1)
The recommended way to install is through Composer:, (*2)
First, install Composer:, (*3)
$ curl -sS https://getcomposer.org/installer | php $ php composer.phar require livespace/livespace-php
Finally, you can include the files in your PHP script:, (*4)
require "vendor/autoload.php";
use Livespace\Livespace;
$client = new Livespace(array(
'api_url' => 'https://****.livespace.io',
'api_key' => '*****',
'api_secret' => '*****'
));
$contactData = array(
'contact' => array(
'firstname' => 'John',
'lastname' => 'Smith',
'company' => array(
'name' => 'Company'
)
)
);
$result = $client->call('Contact/addContact', $contactData);
if ($result->getStatus()) {
echo 'OK' . "\r\n";
var_export($result->getResponseData());
} else {
echo 'ERROR #' . $result->getResult() . ":\r\n";
print_r($result->getError());
}
Livespace API client