intercom-client
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -60,3 +60,3 @@ 'use strict'; | ||
value: function ping(f) { | ||
unirest.get('https://api.intercom.io/admins').auth(this.appId, this.appApiKey).type('json').header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.1.2').end(function (r) { | ||
unirest.get('https://api.intercom.io/admins').auth(this.appId, this.appApiKey).type('json').header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.4.1').end(function (r) { | ||
return f(r.status); | ||
@@ -70,3 +70,3 @@ }); | ||
unirest.post('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').send(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.1.2').end(function (r) { | ||
unirest.post('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').send(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.4.1').end(function (r) { | ||
return _this.callback(f, r); | ||
@@ -80,3 +80,3 @@ }); | ||
unirest.get('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').query(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.1.2').end(function (r) { | ||
unirest.get('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').query(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.4.1').end(function (r) { | ||
return _this2.callback(f, r); | ||
@@ -90,3 +90,3 @@ }); | ||
unirest.get(paginationObject.next).auth(this.appId, this.appApiKey).type('json').header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.1.2').end(function (r) { | ||
unirest.get(paginationObject.next).auth(this.appId, this.appApiKey).type('json').header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.4.1').end(function (r) { | ||
return _this3.callback(f, r); | ||
@@ -100,3 +100,3 @@ }); | ||
unirest['delete']('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').query(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.1.2').end(function (r) { | ||
unirest['delete']('https://api.intercom.io' + endpoint).auth(this.appId, this.appApiKey).type('json').query(data).header('Accept', 'application/json').header('User-Agent', 'intercom-node-client/0.4.1').end(function (r) { | ||
return _this4.callback(f, r); | ||
@@ -103,0 +103,0 @@ }); |
{ | ||
"name": "intercom-client", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Official Node bindings to the Intercom API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node", |
@@ -50,2 +50,19 @@ # intercom-node | ||
## Callbacks | ||
This client library supports two kinds of callbacks: | ||
```node | ||
client.users.list(function (d) { | ||
// d is the response from the server | ||
}); | ||
// Or | ||
client.users.list(function (err, d) { | ||
// err is an error response object, or null | ||
// d is a successful response object, or null | ||
}); | ||
``` | ||
## Users | ||
@@ -52,0 +69,0 @@ |
25667
299