intercom-client
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -87,2 +87,3 @@ 'use strict'; | ||
this.contacts = new _contact2['default'](this); | ||
this.leads = new _contact2['default'](this); | ||
this.counts = new _counts2['default'](this); | ||
@@ -116,3 +117,3 @@ this.admins = new _admin2['default'](this); | ||
if (err) { | ||
reject(err); | ||
reject(new Error(JSON.stringify(err))); | ||
} else { | ||
@@ -119,0 +120,0 @@ resolve(data); |
{ | ||
"name": "intercom-client", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Official Node bindings to the Intercom API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node", |
@@ -115,7 +115,7 @@ # intercom-node | ||
## Contacts | ||
## Leads | ||
```node | ||
// Create a contact | ||
client.contacts.create(function (r) { | ||
client.leads.create(function (r) { | ||
console.log(r); | ||
@@ -127,3 +127,3 @@ }); | ||
// Update a contact by id | ||
client.contacts.update({ id: '5435345', email: 'wash@serenity.io' }, callback); | ||
client.leads.update({ id: '5435345', email: 'wash@serenity.io' }, callback); | ||
``` | ||
@@ -133,3 +133,3 @@ | ||
// List contacts | ||
client.contacts.list(callback); | ||
client.leads.list(callback); | ||
``` | ||
@@ -139,3 +139,3 @@ | ||
// List contacts by email | ||
client.contacts.listBy({ email: 'wash@serenity.io' }, callback); | ||
client.leads.listBy({ email: 'wash@serenity.io' }, callback); | ||
``` | ||
@@ -146,3 +146,3 @@ | ||
// Find contact by id | ||
client.contacts.find({ id: '5342423' }, callback); | ||
client.leads.find({ id: '5342423' }, callback); | ||
``` | ||
@@ -152,7 +152,7 @@ | ||
// Delete contact by id | ||
client.contacts.delete({ id: '5342423' }, callback); | ||
client.leads.delete({ id: '5342423' }, callback); | ||
``` | ||
```node | ||
// Convert Contacts into Users | ||
// Convert Leads into Users | ||
var conversion = { | ||
@@ -162,3 +162,3 @@ contact: { user_id: '1234-5678-9876' }, | ||
}; | ||
client.contacts.convert(conversion, callback); | ||
client.leads.convert(conversion, callback); | ||
``` | ||
@@ -366,2 +366,14 @@ | ||
client.conversations.reply(reply, callback); | ||
// Reply to a conversation with attachments | ||
var reply = { | ||
id: '1039067180', | ||
intercom_user_id: '55b26822ce97179e52001334', | ||
body: 'Some reply :)', | ||
type: 'user', | ||
message_type: 'comment', | ||
attachment_urls: ['http://www.example.com/myattachment.jpg'] | ||
}; | ||
client.conversations.reply(reply, callback); | ||
``` | ||
@@ -368,0 +380,0 @@ |
37864
654
434