This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Description
- Add push method in lead.js
push: function(input, options) {
if (!.isArray(input) && !.isEmpty(input)) {
var msg = 'input must be an array of leads';
log.error(msg);
return Promise.reject(msg);
}
var data = _.extend({}, options, {
input: input
});
var path = util.createPath('leads', 'push.json');
return this._connection.postJson(path, data)
.then(function(data) {
if (data.success) {
return data;
} else {
log.warn('Cannot push lead: ', data);
return Promise.reject('Cannot get lead(s) from input: ' + JSON.stringify(input));
}
});
},
- Add documentation in the API doc API.md
lead.push(input, options)
Implements Push Leads
| param |
type |
description |
input |
Array |
An array of lead records to push |
options |
object |
|
|
lookupField: the field used to dedup on |
|
|
programName : the program name in Marketo |
|
// Push a lead to Marketo program name
marketo.lead.push(
[{'email': '[email protected]'}, {'email': '[email protected]'}],
{lookupField: 'email', programName: 'Test program name'}
)