intercom-api
v0.1.1
Published
A Node client for the intercom.io api
Downloads
4
Maintainers
Readme
intercom-api
Node client for the intercom.io api
intercom-api uses Stallion so it's minimal code, easy to add new methods and promised based
Installation
npm install intercom-api --save
Support Resources
All methods are supported on all the below resources
* https://api.intercom.io/admins
* https://api.intercom.io/companies
* https://api.intercom.io/contacts
* https://api.intercom.io/counts
* https://api.intercom.io/events
* https://api.intercom.io/notes
* https://api.intercom.io/segments
* https://api.intercom.io/tags
* https://api.intercom.io/users
Overview
intercom.io is a simple wrapper around the Intercom.io api so requests and responses follow their documentation
All methods return a ES6 promise.
Creating a client
require Intercom = require('intercom-api');
// You can find these in your app's integrations page under the "API Keys" section
var app_id = 'jbslxytr';
var api_key = '72cdef54ab2f9ecc53cc806a1b6c4ab3d40f14a4';
var intercom = new Intercom(app_id, api_key);
Users
For the complete list of user attributes for the request & response see the User Model
var data =
user_id: 123,
email: '[email protected]',
name: 'Joe Montana'
};
intercom.createUser(data).then(function(user) {
// User will be an object
// {
// id:
// user_id: 3,
// name: "Joe Montana",
// ...
// updated_at: 1398269574
// }
});
Companies
Will add more examples soon, but they all follow the same pattern just take a look at the Intercom.io api docs
Todo
- Add support for https://api.intercom.io/conversations
- Add support for https://api.intercom.io/messages
- Add convenience method to get users for a company
- Add convenience method to remove a company from user
- Add convenience method to add a company to user
- Add convenience methods to
- Add tag to users & companies (tagUser, tagUsers, tagCompany, tagCompanies)
- Remove tag from users & companies
- What about adding multiple tags?