amocrm_api
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "amocrm_api", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "AmoCRM API Module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,31 +7,3 @@ const Amo = require('../'); | ||
async function runTests() { | ||
crm.on('addContacts', (contacts) => { | ||
console.log(contacts); | ||
}); | ||
crm.on('updateContacts', (contacts) => { | ||
console.log(contacts); | ||
}); | ||
crm.on('statusLeads', (leads) => { | ||
for(let lead of leads) { | ||
if(lead.status_id == 16013731) { | ||
crm.api.getLeadsList({ | ||
id: lead.id | ||
}).then((lead_info) => { | ||
console.log(lead_info.leads[0].main_contact_id); | ||
crm.api.getContactsList({ | ||
id: lead_info.leads[0].main_contact_id | ||
}).then((contacts) => { | ||
console.log(contacts); | ||
}).catch(console.error); | ||
}) | ||
//console.log('Searching master for: ' + lead.name); | ||
} | ||
} | ||
}); | ||
let authInfo = await crm.api.auth(); | ||
crm.setupWebhook(); | ||
let currentAccount = await crm.api.getCurrentAccount(); | ||
let contactInfo = await crm.api.setContacts({ | ||
@@ -41,23 +13,6 @@ add: [ | ||
name: 'Иван Иванов', | ||
// custom_fields: [ | ||
// { | ||
// id: 50917, | ||
// values: [ | ||
// { | ||
// value: 1351341 | ||
// } | ||
// ] | ||
// }, | ||
// { | ||
// id: 51215, | ||
// values: [ | ||
// { | ||
// value: | ||
// } | ||
// ] | ||
// } | ||
// ] | ||
} | ||
] | ||
}); | ||
console.log(JSON.stringify(contactInfo, null, 4)); | ||
} | ||
@@ -64,0 +19,0 @@ |
13402
422