salesforcer

0.0.2 • Public • Published

Salesforcer Lead Poster

This is a module for the purpose of saving leads to salesforce via the Rest API. This module only supports the Session ID Authorization model.

You will need to obtain a clientId and a clientSecret. Please see documentation for more information. Salesforce Rest Api Documentation

var SalesForcer = require('salesforcer');
 
var sales = new SalesForcer({
    clientId: 'clientId',
    clientSecret: 'clientSecret',
    username: 'username',
    password: 'password'
})
 
sales
    .createLead({
        email: 'me@bop.com',
        firstName: 'TESTAPILEAD',
        company: "My Test Company",
        lastName: 'fredrick'
    }, function (err, result) {
        // do something with results
    });

Important

Please make sure to read about the security token here

Basically, you will have to append your security token to the end of your password. It tripped me up for a while until I found this information buried in the docs.

from the docs:

For access via the API or a client, users must add their security token (or time-based token if Two-Factor Authentication on API Logins is set on the user’s profile and the user has added a time-based token to his or her account) to the end of their password in order to log in.

A security token is an automatically-generated key from Salesforce. For example, if a user’s password is mypassword, and the security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in. Or, some client applications have a separate field for the security token. Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user’s Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset.

Readme

Keywords

none

Package Sidebar

Install

npm i salesforcer

Weekly Downloads

0

Version

0.0.2

License

none

Last publish

Collaborators

  • isaacross