-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial examples to the README file
- Loading branch information
David Coallier
committed
Apr 1, 2010
1 parent
66cd5b9
commit 740e3fd
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## Introduction | ||
This is the PHP API Wrapper that allows developers to access the Capsule CRM api using PHP | ||
|
||
## Examples | ||
|
||
Get a **party** by party id: | ||
|
||
require_once 'Services/Capsule.php'; | ||
|
||
try { | ||
$capsule = new Services_Capsule('appName', 'token'); | ||
$party = $capsule->party->get('partyId'); | ||
} catch (Services_Capsule_Exception $e) { | ||
print_r($e); | ||
} | ||
|
||
print_r($party); | ||
|
||
Get all **party**: | ||
|
||
require_once 'Services/Capsule.php'; | ||
|
||
try { | ||
$capsule = new Services_Capsule('appName', 'token'); | ||
$parties = $capsule->party->getList(); | ||
} catch (Services_Capsule_Exception $e) { | ||
print_r($e); | ||
} | ||
|
||
print_r($parties); | ||
|
||
Get a list of people in a **party**: | ||
|
||
require_once 'Services/Capsule.php'; | ||
|
||
try { | ||
$capsule = new Services_Capsule('appName', 'token'); | ||
$people = $capsule->party->people->getAll('partyId'); | ||
} catch (Services_Capsule_Exception $e) { | ||
print_r($e); | ||
} | ||
|
||
print_r($people); | ||
|
||
|
||
Add a new history note to a **party**: | ||
|
||
require_once 'Services/Capsule.php'; | ||
|
||
try { | ||
$capsule = new Services_Capsule('appName', 'token'); | ||
$note = $capsule->party->history->addNote( | ||
'partyId', 'This is a test note.' | ||
); | ||
} catch (Services_Capsule_Exception $e) { | ||
print_r($e); | ||
} | ||
|
||
var_dump($note); // This will be true if success | ||
|
||
Get a list of **opportunity**: | ||
|
||
require_once 'Services/Capsule.php'; | ||
|
||
try { | ||
$capsule = new Services_Capsule('appName', 'token'); | ||
$opps = $capsule->opportunity->getList(); | ||
} catch (Services_Capsule_Exception $e) { | ||
print_r($e); | ||
} | ||
|
||
print_r($opps); |