Client wrapper for Node.js integration with RDStation.
$ npm install --save rdstation-node-client
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');
Set a deal as won
var value = 120.00;
var email = 'email@example.com';
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);
});
Create a new conversion
var identifier = 'action-name';
conversions.createConversion('action-name', {
email: 'email@example.com',
nome: 'Lead name',
}).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
Change a lead stage to Lead
var email = 'email@example.com';
var opportunity = false;
leads.chageStatusToLead(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@example.com';
var opportunity = false;
leads.chageStatusToQualified(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@example.com';
var opportunity = false;
leads.chageStatusToClient(email, opportunity).then(function (data) {
console.log('Request done ', data);
})
.catch(function (err) {
console.error(err);
});
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.
MIT © Agendor