You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details.
6
3
7
4
This is the official Pipedrive API wrapper-client for NodeJS based apps, distributed by Pipedrive Inc freely under the MIT licence. It provides you with basic functionality for operating with objects such as Deals, Persons, Organizations, Products and much more, without having to worry about the underlying networking stack and actual HTTPS requests.
Get all objects, optionally passing additional parameters (such as ```filter_id``` in case of deals, persons and organizations). Returns ```error, objects``` to the callback function where objects is a collection (array) of objects.
80
97
81
-
### pipedrive.{Object}.remove (id, [fn callback])
98
+
####pipedrive.{Object}.remove (id, [fn callback])
82
99
Delete an object with a specifc ID. Returns ```error``` in case of an error to the callback.
Find objects of certain kind by their name/title, using `term` property supplied inside params object. Supported for:
94
111
* Deals
95
112
* Persons
96
113
* Organizations
97
114
* Users
98
115
99
-
# Supported operations for each object
116
+
###Supported operations for each object
100
117
101
-
### {object}.get(fieldName)
118
+
####{object}.get(fieldName)
102
119
Returns the value of [fieldName] of the object.
103
120
104
-
### {object}.set(fieldName, newValue)
121
+
####{object}.set(fieldName, newValue)
105
122
Sets a new value of [fieldName] of the object. Returns {object}.
106
123
107
-
### {object}.save([fn callback])
124
+
####{object}.save([fn callback])
108
125
Updates the state of the {object} in Pipedrive via the API. Returns {object}.
109
126
110
-
### {object}.remove([fn callback])
127
+
####{object}.remove([fn callback])
111
128
Deletes the {object} in Pipedrive via the API. Returns ```error``` in case of an error to the callback.
112
129
113
-
### {object}.merge(withId, [fn callback])
130
+
####{object}.merge(withId, [fn callback])
114
131
Merges the {object} with another object of the same kind with the ID given as ```withId```. Returns ```error``` in case of error to the callback. Merge is only supported for the following objects:
115
132
* Persons
116
133
* Organizations
117
134
118
-
# Operations with nested objects
135
+
###Operations with nested objects
119
136
120
-
## Adding a product to a deal
137
+
####Adding a product to a deal
121
138
122
139
To add a product to a deal, simply invoke the ```addProduct``` method on a deal object.
## You can add multiple products with a single request, too.
149
+
####You can add multiple products with a single request, too.
133
150
134
151
To add multiple products with a single request, make the first argument of deal's ```addProduct``` method (as shown above) an array, e.g. ```[{ product_id: 1, quantity: 5, discount: 0 }, { product_id: 1, quantity: 2, discount: 20 }]```. This will add two product rows to a deal — one with a quantity of 5 and with no discount, the latter will add a separate row for the same product but with a quantity of 2 and no discount.
The API client lets you create event listeners to specific data changes in your Pipedrive account. This is very similar to Webhooks, except the listeners are bound on an ad hoc basis and will only be executed during the lifecycle of your application. For example (see below) you may want to execute a callback every time a new deal is added to Pipedrive. Note that this callback will execute not only when you create the deal through this API client but regardless of where the deal was added from — a mobile app, the web app or through the Pipedrive API by some other integration.
234
-
235
-
```js
236
-
var Pipedrive =require('pipedrive');
237
-
var pipedrive =newPipedrive.Client('PUT_YOUR_API_TOKEN_HERE', { strictMode:true });
console.log('A deal was added! '+data.current.title+' ('+data.current.value+''+data.current.currency+')');
241
-
});
242
-
```
243
-
244
-
Supported event names consist of object type (deal, person, organization, ...) and type of change (`added`, `deleted`, `updated` or `merged`), joined by a dot. The list of supported object types are listed in the [Pipedrive Webhooks documentation](https://app.pipedrive.com/webhooks).
245
-
246
-
To read more about ad hoc data change event listeners, check out [examples/live-updates.js](examples/live-updates.js).
247
-
248
-
# API Documentation
249
-
250
-
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
251
-
252
-
# Testing
253
-
To run unit tests, execute `npm run tests`
254
-
255
-
# Licence
256
-
257
-
This Pipedrive API client is distributed under the MIT licence.
0 commit comments