Coder Social home page Coder Social logo

rdstation-node-client's Introduction

NPM version Build Status Dependency Status

Client wrapper for Node.js integration with RDStation.

Install

$ npm install --save rdstation-node-client

Usage

First, initialize the resource

Currently, there are Services and Conversions modules.

var rdclient = require('rdstation-node-client');
var services = new rdclient.Services('your_private_token');

Services

Set a deal as won

var value = 120.00;
var email = '[email protected]';

return services.dealWon(value, email)
    .then(function (data) {
        console.log('Request done ', data);
    })
    .catch(function (err) {
        console.error(err);
    });

Set a deal as lost

var reason = 'Customer chose competitor product';
var leadId = 9999;

return services.dealLost(reason, null, leadId)
    .then(function (data) {
        console.log('Request done ', data);
    })
    .catch(function (err) {
        console.error(err);
    });

Conversions

Create a new conversion

var identifier = 'action-name';

return conversions.createConversion('action-name', {
    email: '[email protected]',
    nome: 'Lead name',
}).then(function (data) {
    console.log('Request done ', data);
})
.catch(function (err) {
    console.error(err);
});

Future development

Currently, this wrapper helps to:

  1. Make the request "Close a deal and mark a deal as lost" described in this article.
  2. Make the request to create a new conversion as described in this article.

There are few more possible actions with RD Station API as described here like "Send a lead or change a lead state".

License

MIT © Agendor

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.