@madkudu/hubspot
A node wrapper for the HubSpot API
Last updated 3 years ago by pcothenet .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @madkudu/hubspot 
SYNC missed versions from official npm registry.

node-hubspot

CircleCI Code Climate Test Coverage Issue Count Dependencies

Node.js wrapper for the HubSpot API

Installing

npm install @madkudu/hubspot

Usage

const Hubspot = require('hubspot');
const hubspot = new Hubspot({ apiKey: 'abc' });

You can also authenticate via token:

const hubspot = new Hubspot({ accessToken: 'abc' });

To change the base url

const hubspot = new Hubspot({ accessToken: 'abc', baseUrl: 'https://some-url' });

And then use the API method via:

hubspot.contacts.get(options)
  .then(results => {
    console.log(results)
  }).catch(err => {
    console.error(err)
  })

or if you prefer callbacks:

hubspot.contacts.get(function(err, results) {
  if (err) { console.error(err) }
  console.log(results);
});

Available Methods

Companies

hubspot.companies.get(opts, cb)
hubspot.companies.getById(id, cb)
hubspot.companies.getRecentlyCreated(opts, cb)
hubspot.companies.getRecentlyModified(opts, cb)
hubspot.companies.getByDomain(domain, cb)
hubspot.companies.create(data, cb)
hubspot.companies.addContactToCompany(data, cb); // data = { companyId: 123, contactVid: 123 }

Contacts

hubspot.contacts.get(opts, cb)
hubspot.contacts.getByEmail(email, cb)
hubspot.contacts.getByEmailBatch(emails, cb)
hubspot.contacts.getById(id, cb)
hubspot.contacts.getByIdBatch(ids, cb)
hubspot.contacts.update(id, data, cb)
hubspot.contacts.create(data, cb)
hubspot.contacts.createOrUpdateBatch(data, cb)
hubspot.contacts.search(query, cb)
hubspot.contacts.getRecent(cb)
hubspot.contacts.createOrUpdate(email, data, cb)
hubspot.contacts.properties.get(cb)

Deals

hubspot.deals.get(opts, cb)
hubspot.deals.getRecentlyModified(opts, cb)
hubspot.deals.getRecentlyCreated(opts, cb)
hubspot.deals.getById(id, cb)
hubspot.deals.deleteById(id, cb)
hubspot.deals.updateById(id, data, cb)
hubspot.deals.create(data, cb)
hubspot.deals.associate(id, objectType, associatedObjectId, cb)
hubspot.deals.removeAssociation(id, objectType, associatedObjectId, cb)

Engagements

hubspot.engagements.create(data, cb)

Owners

hubspot.owners.get(opts, cb)

Pipelines

hubspot.pipelines.get(opts, cb)

Lists

hubspot.lists.get(opts, cb)
hubspot.lists.getOne(id, cb)
hubspot.lists.getContacts(id, opts, cb)
hubspot.lists.getRecentContacts(id, opts, cb)
hubspot.lists.addContacts(id, contactBody, cb)

Files

hubspot.files.get(cb)
hubspot.files.getOne(id, cb)

Email

hubspot.subscriptions.get(opts, cb)

### Email Events

```javascript
hubspot.campaigns.get(opts, cb)
hubspot.campaigns.getOne(id, appId, cb)
hubspot.campaigns.events(opts, cb)

Social Media

hubspot.broadcasts.get(opts, cb)

License

MIT

Contributors

Brian Falk @brainflake Tim Atkinson @timisbusy Tejas Manohar @tejasmanohar Krispin Schulz @kr1sp1n Filipe Ferreira @iTsFILIPOficial Paul Cothenet @pcothenet

Current Tags

  • 1.0.0-beta3                                ...           latest (3 years ago)

5 Versions

  • 1.0.0-beta3                                ...           3 years ago
  • 1.0.0-beta2                                ...           3 years ago
  • 1.0.0-beta1                                ...           3 years ago
  • 1.0.0-alpha1                                ...           3 years ago
  • 0.4.5                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |