Client wrapper for Node.js integration with RDStation.
$ npm install --save rdstation-node-client
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');
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);
});
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);
});
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.
There are few more possible actions with RD Station API as described here like "Send a lead or change a lead state".
MIT © Agendor