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







 
 
Web Service

To get your data from our WebService, copy the following code to your script.
The available module for Live-Office WebService are:

  • AddressBook
  • Budget
  • Document
  • Note
  • Organizer
  • ToDo

The available actions are:
  • download
  • getAllData
  • add
  • update
  • delete

** For each module, please refer to the p100 - Data Model document.


Developer Documentation
Back to Top
 
 
Web Service - Get a record

To get a record, you need to prodive the following information:

  • Username
  • Password (encrypted with md5)
  • Id of the record*
  • Module
  • Action
*Note: the id of the record is the primary key


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
Back to Top
 
 
Web Service - Get all record

To get a record, you need to prodive the following information:

  • Username
  • Password (encrypted with md5)
  • Id of the record*
  • Module
  • Action
*Note: the id of the record is the primary key


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
Back to Top
 
 
Web Service - Add a record

To add a record, you need to prodive the following information:

  • Username
  • Password (encrypted with md5)
  • Module
  • Action
*Note: the id of the record is the primary key


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
Back to Top
 
 
Web Service - Update a record

To update a record, you need to prodive the following information:

  • Username
  • Password (encrypted with md5)
  • Id of the record*
  • Module
  • Action
*Note: the id of the record is the primary key


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
Back to Top
 
 
Web Service - Delete a record

To delete a record, you need to prodive the following information:

  • Username
  • Password (encrypted with md5)
  • Id of the record*
  • Module
  • Action
*Note: the id of the record is the primary key


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
Back to Top