GithubHelp home page GithubHelp logo

node-hubspot's Introduction

This repository is now considered legacy and no longer supported. Please take a look at our recent repositories and help documentation at the following links.

node-hubspot

A node.js library for the hubspot API (further details: https://developers.hubspot.com)

node-hubspot exposes the following features of the hubspot API to your node.js application:

Caution - some of these routes are not officially supported or listed in the api and may change

Version v3

  • user-details

Installation

Installing using npm (node package manager):

npm install node-hubspot

If you don't have npm installed or don't want to use it:

cd ~/.node_libraries
git clone [email protected]:Datahero/node-hubspot.git

Please note that parts of node-hubspot depend on request by Mikeal Rogers. This library needs to be installed for the API to work. Additionally node-querystring is required. If you are using npm all dependencies should be automagically resolved for you.

Usage

Information on how to use the hubspot APIs can be found below. Further information on the API methods available can be found at https://developer.hubspot.com. You can also find further information on how to obtain an API key, and/or OAuth2 in your hubspot account and much more on the hubspot API pages.

hubspot API

hubspotAPI takes an options object, The only required option for version3 of the api is an oAuth token.

http://developer.hubspot.com/docs/auth/

All API requests must be authenticated with a valid OAuth token. Tokens are tied to user accounts; if you’re just using the API for a single user or organizer, then follow ‘Personal Tokens’ if you’re using the API for many hubspot users, then follow ‘OAuth Token Flow’. which you can find in your hubspot Account. The second argument is an options object which can contain the following options:

required options:

  • token

available options

  • version The API version to use. Defaults to v3.
  • userAgent Custom User-Agent description to use in the request header.
  • contentType defaults to application/json and currently the api only supports json

The callback function for each API method gets two arguments, an error and results object.

The error object is null when no error occured. The results object contains all information retrieved as long as no error occurred.

Example:

var hubspotAPI = require('hubspot');

var token = 'a users hubspot API token';

try {
    var api = hubspotAPI({
      token: token,
      version : 'v3'
    });
} catch (error) {
    console.log(error.message); // the options are missing, this function throws an error.
}

api.sources({ user_id: 30 }, function (error, data) {
    if (error)
        console.log(error.message);
    else
        console.log(JSON.stringify(data)); // Do something with your data!
});

Events

Sources

Pages

Contacts

Prospects

License

node-hubspot is licensed under the MIT License. (See LICENSE)

Contributors

node-hubspot's People

Contributors

damianhodgkiss avatar mc-escherichia avatar nemo avatar randallknutson avatar travist avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.