rdstation-node-client
v1.2.0
Published
Client wrapper for Node.js integration with RDStation.
Downloads
222
Maintainers
Readme
Client wrapper for Node.js integration with RDStation.
Install
$ npm install --save rdstation-node-client
Usage
First, initialize the resource
Currently, there are Services
, Conversions
and Leads modules.
var rdclient = require('rdstation-node-client');
var services = new rdclient.Services('your_private_token');
var conversions = new rdclient.Conversions('your_token');
var leads = new rdclient.Leads('your_private_token');
Services
Set a deal as won
var value = 120.00;
var email = '[email protected]';
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;
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';
conversions.createConversion('action-name', {
email: '[email protected]',
nome: 'Lead name',
}).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
Leads
Change a lead stage to Lead
var email = '[email protected]';
var opportunity = false;
leads.changeStatusToLead(email, opportunity).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
Change a lead stage to Lead Qualified
var email = '[email protected]';
var opportunity = false;
leads.changeStatusToQualified(email, opportunity).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
Change a lead stage to Client
var email = '[email protected]';
var opportunity = false;
leads.changeStatusToClient(email, opportunity).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
Future development
Currently, this wrapper helps to:
- Make the request "Close a deal and mark a deal as lost" described in this article.
- Make the request to create a new conversion as described in this article.
- Make the request to change a lead stage described in this article.
There are few more possible actions with RD Station API as described here.
License
MIT © Agendor