|
|
![]() |
|
|
Created: December 6th, 2008 Author(s): Eric Potvin Copyright © 2010 live-office.net All Rights Reserved Release revision: 1.0 Release revision Date: December 6th, 2008 |
Developer Documentation
All future revisions to this document shall be approved by Eric Potvin prior to release.
The information contained herein is PROPRIETARY to Live-Office (live-office.net)
and shall not be reproduced or disclosed in whole or in part or used for any purpose.
|
|
|
|
|
To get your data from our WebService, copy the following code to your script.
The available actions are:
** For each module, please refer to the p100 - Data Model document. |
|
|
|
|
|
Developer Documentation
|
|
|
To get a record, you need to prodive the following information:
Example:
<?php
$data['user'] = 'user@domain.com'; //Username
$data['pass'] = md5('my_password'); //Password (md5 encoded)
$data['id'] = 3; //Id of the record.
$data['module'] = 'addressbook'; //Module
$data['action'] = 'download'; //Action
$Curl = curl_init('http://[url]/webservice.php');
curl_setopt($Curl, CURLOPT_HEADER, 0);
curl_setopt($Curl, CURLOPT_POST, 1);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec($Curl);
curl_close($Curl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-type: application/xml; charset="utf-8"',true);
echo $xml;
|
|
|
|
|
|
Developer Documentation
|
|
|
To get a record, you need to prodive the following information:
Example:
<?php
$data['user'] = 'user@domain.com'; //Username
$data['pass'] = md5('my_password'); //Password (md5 encoded)
$data['module'] = 'addressbook'; //Module
$data['action'] = 'getAllData'; //Action
$Curl = curl_init('http://[url]/webservice.php');
curl_setopt($Curl, CURLOPT_HEADER, 0);
curl_setopt($Curl, CURLOPT_POST, 1);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec($Curl);
curl_close($Curl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-type: application/xml; charset="utf-8"',true);
echo $xml;
|
|
|
|
|
|
Developer Documentation
|
|
|
To add a record, you need to prodive the following information:
Example:
<?php
$data['user'] = 'user@domain.com'; //Username
$data['pass'] = md5('my_password'); //Password (md5 encoded)
$data['module'] = 'addressbook'; //Module
$data['action'] = 'add'; //Action
$record = array(
'prefix' => 'mr',
'last_name' => 'Doe',
'first_name' => 'John',
'company' => 'John Doe Inc.',
'birthday' => '1970-01-01',
'group' => 'work',
'street' => '2269 Dan Marino Boulevard',
'city' => 'Miami',
'state' => 'Florida',
'zip' => '33056',
'country' => 'USA',
'home_phone' => '305-111-1111',
'work_phone' => '305-222-2222',
'cell_phone' => '306-333-3333',
'email' => 'email@domain.com',
'www' => 'http://www.domain.com',
'favorite' => 1
);
$data = array_merge($data, $record);
$Curl = curl_init('http://[url]/webservice.php');
curl_setopt($Curl, CURLOPT_HEADER, 0);
curl_setopt($Curl, CURLOPT_POST, 1);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec($Curl);
curl_close($Curl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-type: application/xml; charset="utf-8"',true);
echo $xml;
|
|
|
|
|
|
Developer Documentation
|
|
|
To update a record, you need to prodive the following information:
Example:
<?php
$data['user'] = 'user@domain.com'; //Username
$data['pass'] = md5('my_password'); //Password (md5 encoded)
$data['id'] = 3; //Id of the record.
$data['module'] = 'addressbook'; //Module
$data['action'] = 'update'; //Action
$record = array(
'prefix' => 'mrs',
'last_name' => 'Smith',
'first_name' => 'Jane',
'company' => 'Jane Smith LLC',
'birthday' => '1970-12-12',
'group' => 'work',
'street' => '2269 Dan Marino Boulevard',
'city' => 'Miami',
'state' => 'Florida',
'zip' => '33056',
'country' => 'USA',
'home_phone' => '305-111-1111',
'work_phone' => '305-222-2222',
'cell_phone' => '306-333-3333',
'email' => 'email@domain.com',
'www' => 'http://www.domain.com',
'favorite' => 1
);
$data = array_merge($data, $record);
$Curl = curl_init('http://[url]/webservice.php');
curl_setopt($Curl, CURLOPT_HEADER, 0);
curl_setopt($Curl, CURLOPT_POST, 1);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec($Curl);
curl_close($Curl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-type: application/xml; charset="utf-8"',true);
echo $xml;
|
|
|
|
|
|
Developer Documentation
|
|
|
To delete a record, you need to prodive the following information:
Example:
<?php
$data['user'] = 'user@domain.com'; //Username
$data['pass'] = md5('my_password'); //Password (md5 encoded)
$data['id'] = 3; //Id of the record.
$data['module'] = 'addressbook'; //Module
$data['action'] = 'delete'; //Action
$Curl = curl_init('http://[url]/webservice.php');
curl_setopt($Curl, CURLOPT_HEADER, 0);
curl_setopt($Curl, CURLOPT_POST, 1);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec($Curl);
curl_close($Curl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-type: application/xml; charset="utf-8"',true);
echo $xml;
|
|
|
|
|
|
Developer Documentation
|
|