Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (50 sloc) 1.709 kb
740e3fd Added initial examples to the README file
David Coallier authored
1 ## Introduction
2 This is the PHP API Wrapper that allows developers to access the Capsule CRM api using PHP
3
4 ## Examples
5
6 Get a **party** by party id:
7
8 require_once 'Services/Capsule.php';
9
10 try {
11 $capsule = new Services_Capsule('appName', 'token');
12 $party = $capsule->party->get('partyId');
13 } catch (Services_Capsule_Exception $e) {
14 print_r($e);
15 }
16
17 print_r($party);
18
19 Get all **party**:
20
21 require_once 'Services/Capsule.php';
22
23 try {
24 $capsule = new Services_Capsule('appName', 'token');
25 $parties = $capsule->party->getList();
26 } catch (Services_Capsule_Exception $e) {
27 print_r($e);
28 }
29
30 print_r($parties);
31
32 Get a list of people in a **party**:
33
34 require_once 'Services/Capsule.php';
35
36 try {
37 $capsule = new Services_Capsule('appName', 'token');
38 $people = $capsule->party->people->getAll('partyId');
39 } catch (Services_Capsule_Exception $e) {
40 print_r($e);
41 }
42
43 print_r($people);
44
45
46 Add a new history note to a **party**:
47
48 require_once 'Services/Capsule.php';
49
50 try {
51 $capsule = new Services_Capsule('appName', 'token');
52 $note = $capsule->party->history->addNote(
53 'partyId', 'This is a test note.'
54 );
55 } catch (Services_Capsule_Exception $e) {
56 print_r($e);
57 }
58
59 var_dump($note); // This will be true if success
60
61 Get a list of **opportunity**:
62
63 require_once 'Services/Capsule.php';
64
65 try {
66 $capsule = new Services_Capsule('appName', 'token');
67 $opps = $capsule->opportunity->getList();
68 } catch (Services_Capsule_Exception $e) {
69 print_r($e);
70 }
71
72 print_r($opps);
Something went wrong with that request. Please try again.