This is the official Pipedrive API wrapper/client for NodeJS apps, distributed by Pipedrive Inc free 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.
npm install pipedrive
With a pre-set API token:
var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');
Here's a quick example that will list some deals from your Pipedrive account:
var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');
pipedrive.Deals.getAll({}, function(err, deals) {
if (err) throw err;
for (var i = 0; i < deals.length; i++) {
console.log(deals[i].title + ' (worth ' + deals[i].value + ' ' + deals[i].currency + ')');
}
});
- Activities
- ActivityTypes
- Authorizations
- Currencies
- Deals
- DealFields
- Filters
- OrganizationFields
- Organizations
- Persons
- PersonFields
- Pipelines
- Products
- ProductFields
- SearchResults
- Stages
- Users
pipedrive.authenticate({ email: '[email protected]', password: 'example' }, [fn callback]);
Fetches the Authorizations objects for the given user against email and password, error, data
to the callback.
Add an object. Returns error, data
to the callback where data contains the id
property of the newly created item.
Get specific object. Returns error, object
Update an object. Returns error
in case of an error to the callback.
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.
Delete an object with a specifc ID. Returns error
in case of an error to the callback.
Delete multiple objects using an array of IDs. Returns error
in case of an error to the callback.
Merge two objects of the same kind. Returns error
in case of an error to the callback. Merge is only supported for the following objects:
- Persons
- Organizations
- Users
Returns the value of [fieldName] of the object.
Sets a new value of [fieldName] of the object. Returns {object}.
Updates the state of the {object} in Pipedrive via the API. Returns {object}.
Deletes the {object} in Pipedrive via the API. Returns error
in case of an error to the callback.
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:
- Persons
- Organizations
- Users
var Pipedrive = require('pipedrive');
var pipedrive = new Pipedrive.Client('PUT_YOUR_API_TOKEN_HERE');
var _ = require('underscore');
pipedrive.Filters.getAll({ type: 'deals' }, function(filtersListErr, filtersList) {
if (filtersList.length > 0) {
pipedrive.Deals.getAll({ filter_id: filtersList[0].get('id'), start: 0, limit: 15 }, function(dealsListErr, dealsList) {
_.each(dealsList, function(deal) {
console.log(deal.get('title') + ' (worth ' + deal.get('value') + ' ' + deal.get('currency') + ')');
});
})
}
});
- Attaching products to deals
- Adding followers to deals/organizations/persons/users
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
This Pipedrive API client is distributed under the MIT licence.