Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning lead to list #33

Open
niravpatel2008 opened this issue Aug 23, 2016 · 0 comments
Open

Assigning lead to list #33

niravpatel2008 opened this issue Aug 23, 2016 · 0 comments

Comments

@niravpatel2008
Copy link

niravpatel2008 commented Aug 23, 2016

Code:

 createLead: function(listID,leadObj) {
                marketo.lead.createOrUpdate(
                        [leadObj],
                        {lookupField: 'email'}
                ).then(function(data) {
                                console.log(data,data.result[0].reasons);
                                if (typeof(data.result[0].id) !== undefined)
                                {
                                        console.log(listID,data.result[0].id);
                                        marketo.list.addLeadsToList(listID, [data.result[0].id]).then(function(data){
                                                console.log(data);
                                        });
                                }
                });
        }

Output:

Possibly unhandled Error: [object Object]
at PromiseResolver$reject as reject
at /opt/pepperdata/node_modules/node-marketo-rest/lib/retry.js:73:17
at tryCatch1 (/opt/pepperdata/node_modules/node-marketo-rest/node_modules/bluebird/js/main/util.js:45:21)
at Promise$_callHandler as _callHandler
at Promise$_settlePromiseFromHandler as _settlePromiseFromHandler
at Promise$_settlePromiseAt as _settlePromiseAt
at Promise$_settlePromises as _settlePromises
at Promise$_rejectPromises as _rejectPromises
at Async$_consumeFunctionBuffer as _consumeFunctionBuffer
at Async$consumeFunctionBuffer (/opt/pepperdata/node_modules/node-marketo-rest/node_modules/bluebird/js/main/async.js:40:14)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback (node.js:390:13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant