intercom.io
http://tarunc.github.io/intercom.io/
An API client in Node.JS for talking to intercom.io. This package implements the complete API (no longer; some of the API) for talking with the intercom.io API -- users, messages, impressions, tags, notes and more. This library's methods support promises (methodName().then(resolve, reject)
)(thru q) and node style callbacks (methodName(function(err, data){ /* callback code */ })
).
There complete docs can be found here - http://doc.intercom.io/api. See docs for complete API documentation of this library and all the methods that we support. See tests for more examples.
NOTE: This library is not maintained be me anymore. Pull requests are still welcome and will be merged appropriately. I recommend using Intercom's Node Library instead.
Installation
To install the latest stable release with the command-line tool:
npm install --save intercom.io
Usage
See this library's docs for complete API documentation and the intercom API documentation.
var Intercom = require('intercom.io');
var options = {
personalAccessToken: "your_access_token",
timeout: 60 * 1000
};
var intercom = new Intercom(options);
var options = {
apiKey: "your_API_key",
appId: "your_APP_ID"
};
var intercom = new Intercom(options);
intercom.createUser({
"email" : "ben@intercom.io",
"user_id" : "7902",
"name" : "Ben McRedmond",
"created_at" : 1257553080,
"custom_data" : {"plan" : "pro"},
"last_seen_ip" : "1.2.3.4",
"last_seen_user_agent" : "ie6",
"companies" : [
{
"id" : 6,
"name" : "Intercom",
"created_at" : 103201,
"plan" : "Messaging",
"monthly_spend" : 50
}
],
"last_request_at" : 1300000000
}, function(err, res) {
});
intercom.getUser({ "email": "ben@intercom.io" }).then(function(res) {
}, function(err) {
});
intercom.getUsers({
page: 1,
per_page: 500,
tag_id: 7002,
tag_name: "me"
}, function (err, res) {
});
List of supported methods: (More methods on docs.)
* intercom.getPages
* intercom.getUsers
* intercom.getUser
* intercom.viewUser
* intercom.createUser
* intercom.updateUser
* intercom.deleteUser
* intercom.bulkAddUsers
* intercom.createContact
* intercom.updateContact
* intercom.deleteContact
* intercom.getContact
* intercom.viewContact
* intercom.getContacts
* intercom.convertContact
* intercom.listCompanies
* intercom.viewCompany
* intercom.createCompany
* intercom.updateCompany
* intercom.listCompanyUsers
* intercom.listAdmins
* intercom.createNote
* intercom.listNotes
* intercom.viewNote
* intercom.getTag
* intercom.createTag
* intercom.deleteTag
* intercom.updateTag
* intercom.listSegments
* intercom.viewSegment
* intercom.createEvent
* intercom.getCounts
* intercom.createUserMessage
* intercom.listConversations
* intercom.getConversation
* intercom.replyConversation
* intercom.markConversationAsRead
* intercom.closeConversation
See docs for complete API documentation and the intercom API documentation. See tests for more examples.
Note: Every method returns a promise but accepts callbacks too.
License
(The MIT License)
Copyright (c) 2013-2018 Tarun Chaudhry <opensource@chaudhry.co>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.