Skip to content

boo1ean/node-amocrm-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AmoCRM API client for nodejs

Simplified API client for AmoCRM.

Installation

npm install amocrm-api

Usage

var AmoCRM = require('amocrm-api');
var amo = new AmoCRM('https://your-domain.amocrm.ru');

amo.auth({
	USER_LOGIN: '[email protected]',
	USER_HASH: 'd10532200r202eefwa9c7eab290237a6'
}).then(function createSomeTasks () {
	return amo.createTask({
		task_type: 1,
		text: 'Task text',
		responsible_user_id: 123,
		complete_till: new Date().getTime()
	});
});

Available methods

auth

auth method should be used to initiate user session. You need to auth before doing any other request.

amo.auth({
	USER_LOGIN: '[email protected]',
	USER_HASH: 'd10532200r202eefwa9c7eab290237a6'
}).then(function doSomethingAuthorized () {
	//...
});

createTask

Create task and assign it to responsible user. For extended usage see official docs.

amo.createTask({
	task_type: 1,
	text: 'Task text',
	responsible_user_id: 123,
	complete_till: new Date().getTime()
});

createContact

Create contact. For extended usage see official docs

amo.createContact({
	name: 'Вася Пупкин',
	responsible_user_id: 540759
}).then(function afterContactCreated (res) {
	console.log(res.id); // created contact id
});

License

MIT

About

AmoCRM api client for nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published