Skip to content

Commit 23ddf61

Browse files
authored
Update README.md
1 parent 7b47b9b commit 23ddf61

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,21 @@ pipedrive.Filters.getAll({ type: 'deals' }, function(filtersListErr, filtersList
227227
});
228228
```
229229

230+
# Ad hoc data change event listeneres
231+
232+
The API client lets you create event listeners to specific data changes in your Pipedrive account. This is very similar to Web Hooks, 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.
233+
234+
```js
235+
var Pipedrive = require('pipedrive');
236+
var pipedrive = new Pipedrive.Client('PUT_YOUR_API_TOKEN_HERE', { strictMode: true });
237+
238+
pipedrive.on('deal.added', function(event, data) {
239+
console.log('A deal was added! ' + data.current.title + ' (' + data.current.value + ' ' + data.current.currency + ')');
240+
});
241+
```
242+
243+
To read more about ad hoc data change event listeners, check out [examples/live-updates.js](examples/live-updates.js).
244+
230245
# API Documentation
231246

232247
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1

0 commit comments

Comments
 (0)