Skip to content

Commit 508ce33

Browse files
authored
Update README.md
1 parent 4365a51 commit 508ce33

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

README.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
# Pipedrive client for NodeJS based apps
2-
3-
[![NPM version](https://badge.fury.io/js/pipedrive.svg)](http://badge.fury.io/js/pipedrive) [![Build Status](https://travis-ci.org/pipedrive/client-nodejs.svg)](https://travis-ci.org/pipedrive/client-nodejs)
4-
52
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.
63

74
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.
85

9-
# Install
10-
6+
## Installation
117
```
128
npm install pipedrive
139
```
1410

15-
# Usage
11+
## Roadmap & known issues
12+
- [Missing async/await promise support](https://github.com/pipedrive/client-nodejs/issues/81)
13+
- Missing oauth 2.0 support
14+
15+
## API Documentation
16+
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
17+
18+
## Testing & Quality
19+
[![NPM version](https://badge.fury.io/js/pipedrive.svg)](http://badge.fury.io/js/pipedrive) [![Build Status](https://travis-ci.org/pipedrive/client-nodejs.svg)](https://travis-ci.org/pipedrive/client-nodejs)
20+
21+
To run unit tests, execute
22+
```bash
23+
npm run test
24+
```
25+
26+
## Licence
27+
This Pipedrive API client is distributed under the MIT licence.
28+
29+
## Contribution
30+
- Run tests
31+
- Make PR
1632

33+
# How to use
1734
With a pre-set API token:
1835
```js
1936
var Pipedrive = require('pipedrive');
2037
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE', { strictMode: true });
2138
```
2239

23-
# A simple "Hello world" that lists some deals
40+
### A simple "Hello world" that lists some deals
2441

2542
Here's a quick example that will list some deals from your Pipedrive account:
2643

@@ -36,7 +53,7 @@ pipedrive.Deals.getAll({}, function(err, deals) {
3653
});
3754
```
3855

39-
# Supported objects
56+
### Supported objects
4057

4158
* Activities
4259
* ActivityTypes
@@ -64,60 +81,60 @@ pipedrive.Deals.getAll({}, function(err, deals) {
6481
* Users
6582
* Webhooks
6683

67-
# Supported operations for object collections
84+
### Supported operations for object collections
6885

69-
### pipedrive.{Object}.add (data, [fn callback])
86+
#### pipedrive.{Object}.add (data, [fn callback])
7087
Add an object. Returns ```error, data``` to the callback where data contains the ```id``` property of the newly created item.
7188

72-
### pipedrive.{Object}.get (id, [fn callback])
89+
#### pipedrive.{Object}.get (id, [fn callback])
7390
Get specific object. Returns ```error, object, additionalData, rawRequest, rawResponse, relatedObjects```
7491

75-
### pipedrive.{Object}.update (id, data, [fn callback])
92+
#### pipedrive.{Object}.update (id, data, [fn callback])
7693
Update an object. Returns ```error``` in case of an error to the callback.
7794

78-
### pipedrive.{Object}.getAll (params, [fn callback])
95+
#### pipedrive.{Object}.getAll (params, [fn callback])
7996
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.
8097

81-
### pipedrive.{Object}.remove (id, [fn callback])
98+
#### pipedrive.{Object}.remove (id, [fn callback])
8299
Delete an object with a specifc ID. Returns ```error``` in case of an error to the callback.
83100

84-
### pipedrive.{Object}.removeMany ([Array ids], [fn callback])
101+
#### pipedrive.{Object}.removeMany ([Array ids], [fn callback])
85102
Delete multiple objects using an array of IDs. Returns ```error``` in case of an error to the callback.
86103

87-
### pipedrive.{Object}.merge (whichId, withId, [fn callback])
104+
#### pipedrive.{Object}.merge (whichId, withId, [fn callback])
88105
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:
89106
* Persons
90107
* Organizations
91108

92-
### pipedrive.{Object}.find (params, [fn callback])
109+
#### pipedrive.{Object}.find (params, [fn callback])
93110
Find objects of certain kind by their name/title, using `term` property supplied inside params object. Supported for:
94111
* Deals
95112
* Persons
96113
* Organizations
97114
* Users
98115

99-
# Supported operations for each object
116+
### Supported operations for each object
100117

101-
### {object}.get(fieldName)
118+
#### {object}.get(fieldName)
102119
Returns the value of [fieldName] of the object.
103120

104-
### {object}.set(fieldName, newValue)
121+
#### {object}.set(fieldName, newValue)
105122
Sets a new value of [fieldName] of the object. Returns {object}.
106123

107-
### {object}.save([fn callback])
124+
#### {object}.save([fn callback])
108125
Updates the state of the {object} in Pipedrive via the API. Returns {object}.
109126

110-
### {object}.remove([fn callback])
127+
#### {object}.remove([fn callback])
111128
Deletes the {object} in Pipedrive via the API. Returns ```error``` in case of an error to the callback.
112129

113-
### {object}.merge(withId, [fn callback])
130+
#### {object}.merge(withId, [fn callback])
114131
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:
115132
* Persons
116133
* Organizations
117134

118-
# Operations with nested objects
135+
### Operations with nested objects
119136

120-
## Adding a product to a deal
137+
#### Adding a product to a deal
121138

122139
To add a product to a deal, simply invoke the ```addProduct``` method on a deal object.
123140
```js
@@ -129,11 +146,11 @@ pipedrive.Deals.get(1, function(err, deal) {
129146
});
130147
})
131148
```
132-
## You can add multiple products with a single request, too.
149+
#### You can add multiple products with a single request, too.
133150

134151
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.
135152

136-
## Updating a deal product
153+
#### Updating a deal product
137154
```js
138155
pipedrive.Deals.get(deal_id, function(err, deal) {
139156
if (err) throw err;
@@ -152,7 +169,7 @@ pipedrive.Deals.get(deal_id, function(err, deal) {
152169
Updating multiple deal products in one request is not supported yet.
153170

154171

155-
## Delete a product from a deal
172+
#### Delete a product from a deal
156173
```js
157174
pipedrive.Deals.get(deal_id, function(err, deal) {
158175
if (err) throw err;
@@ -167,7 +184,7 @@ pipedrive.Deals.get(deal_id, function(err, deal) {
167184
})
168185
```
169186

170-
## Search for field value matches
187+
#### Search for field value matches
171188

172189
There is an additional method to perform the `SearchResults/field` search. This can be used for field-value searches.
173190

@@ -191,7 +208,7 @@ pipedrive.SearchResults.field({
191208
* **start** (optional, default 0) – results pagination start
192209
* **limit** (optional, default 100) — results pagination limit
193210

194-
## Retrieve all records for a given object type:
211+
#### Retrieve all records for a given object type:
195212

196213
You can request all entries for an valid object using `getAll(object, callback)`
197214

@@ -205,9 +222,8 @@ pipedrive.getAll('Persons', function (err, collection) {
205222
});
206223
```
207224

208-
# Examples
209-
210-
## Get 15 first deals using the first deals filter
225+
### Examples
226+
#### Get 15 first deals using the first deals filter
211227

212228
```js
213229
var Pipedrive = require('pipedrive');
@@ -227,18 +243,3 @@ pipedrive.Filters.getAll({ type: 'deals' }, function(filtersListErr, filtersList
227243

228244
});
229245
```
230-
231-
# API Documentation
232-
233-
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
234-
235-
# Testing & Quality
236-
To run unit tests, execute `npm run test`
237-
238-
# Licence
239-
240-
This Pipedrive API client is distributed under the MIT licence.
241-
242-
# Contribution
243-
- Run tests
244-
- Make PR

0 commit comments

Comments
 (0)