Agile CRM is a new breed CRM software with sales and marketing automation.
- 1 To get a contact by email
- 2 To get a contact by contact ID
- 3 To create a contact
- 4 To update a contact
- 5 To delete a contact
- 6 To update tags to a contact
- 7 To delete tags to a contact
- 8 Change owner of a contact
- 1 To get a deal by deal ID
- 2 To get deals by contact id
- 3 To create a deal
- 4 To update a deal
- 5 To delete a deal
- 6 Get deal source
- 1 Create a note to a contact
- 2 Update a note to a contact
- 3 Get note by contact ID
- 4 Delete a note by contact ID and note ID
- 1 Create a task to a contact
- 2 Create a task to a contact by email ID
- 3 Update a task to a contact
- 4 Get a task by task ID
- 5 Delete a task by task ID
$ npm install agile_crm
-
Two files required agilecrm.js and test.js OR
-
Setting Domain Name and API Key
In the above image, API Key is present at the "API & Analytics" tab at https://mycompany.agilecrm.com/#analytics-code
.
Domain Name : mycompany
API Key : myagilecrmapikey
So you have to update your
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
console.log("hello");
};
var error = function (data) {
console.log(data);
};
###1. Contact
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getContactByEmail('[email protected]', success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getContactById('5736096881180672', success, error);
{
"star_value": "4",
"lead_score": "92",
"tags": [
"Lead",
"Likely Buyer"
],
"properties": [
{
"type": "SYSTEM",
"name": "first_name",
"value": "Los "
},
{
"type": "SYSTEM",
"name": "last_name",
"value": "Bruikheilmer"
},
{
"type": "SYSTEM",
"name": "company",
"value": "steady.inc"
},
{
"type": "SYSTEM",
"name": "title",
"value": "VP Sales"
},
{
"type": "SYSTEM",
"name": "email",
"subtype": "work",
"value": "[email protected] "
},
{
"type": "SYSTEM",
"name": "address",
"value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}"
},
{
"type": "CUSTOM",
"name": "My Custom Field",
"value": "Custom value"
}
]
}
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var contact = {
"lead_score": "92",
"tags": [
"Lead",
"Likely Buyer"
],
"properties": [
{
"type": "SYSTEM",
"name": "first_name",
"value": "Los "
},
{
"type": "SYSTEM",
"name": "email",
"subtype": "work",
"value": "[email protected]"
},
{
"type": "SYSTEM",
"name": "address",
"value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}"
}
]
};
obj.contactAPI.add(contact, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var update_contact = {
"id": "5698936018829312",
"properties": [
{
"type": "SYSTEM",
"name": "first_name",
"value": "Losalitest"
},
{
"type": "SYSTEM",
"name": "last_name",
"value": "Lee"
}
]
};
obj.contactAPI.update(update_contact, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.deleteContact('5633009881448448', success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var update_tags = {
"id": "5671839405703168",
"tags": [
"test1",
"test2"
]
};
obj.contactAPI.updateTagsById(update_tags, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var delete_tags = {
"id": "5671839405703168",
"tags": [
"test1"
]
};
obj.contactAPI.deleteTagsById(delete_tags, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.changeContactOwner('[email protected]','5650547373768704',success, error);
###2. Deal
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getDealById('5650703586426880', success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getDealByContactId("5675392618725376", success, error);
{
"name": "Deal-Tomato",
"expected_value": "500",
"probability": "75",
"close_date": 1455042600,
"milestone": "Proposal",
"contact_ids": [
"5758948741218304"
],
"custom_data": [
{
"name": "Group Size",
"value": "10"
}
]
}
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var deal = {
"name": "Deal-Tomato",
"expected_value": "500",
"probability": "75",
"close_date": 1455042600,
"milestone": "Proposal",
"contact_ids": [
"5758948741218304"
],
"custom_data": [
{
"name": "Group Size",
"value": "10"
}
]
};
obj.contactAPI.createDeal(deal, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var update_deal = {
"id": "5122047336251392",
"expected_value": "1000",
"contact_ids": [
"5675392618725376",
"5744178885558278"
],
"custom_data": [
{
"name": "dealTester",
"value": "hello hello2"
}
]
};
obj.contactAPI.updateDeal(update_deal, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.deleteDealById('5650703586426880', success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getDealSource(success, error);
###3. Note
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var note = {
"subject": " Note subject",
"description": "Note description",
"contact_ids": [
"5688267051630592",
"5721389839417344"
]
};
obj.contactAPI.createNote(note, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var update_note = {
"id": "5754615706419200",
"subject": "Test",
"description": "Sample test updated1",
"contact_ids": [
"5630286201094144"
]
};
obj.contactAPI.updateNote(update_note, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getNoteByContactId("5630286201094144", success, error);
- Delete a note from a contact
- first parameter ID is contact and second one is note ID
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.deleteNoteById("5630286201094144","5754615706419200", success, error);
###4. Task
- Task type accepeted value : CALL, EMAIL, FOLLOW_UP, MEETING, MILESTONE, SEND, TWEET, OTHER
- Task priority_type accepeted value : HIGH, NORMAL, LOW
- Task due accepeted value : epoch time in miliseconds
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var task = {
"subject": "test",
"contacts": [
"5630286201094144"
],
"type": "EMAIL",
"priority_type": "HIGH",
"due": 11545245654
};
obj.contactAPI.createTask(task, success, error);
- Task type accepeted value : CALL, EMAIL, FOLLOW_UP, MEETING, MILESTONE, SEND, TWEET, OTHER
- Task priority_type accepeted value : HIGH, NORMAL, LOW
- Task due accepeted value : epoch time in miliseconds
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var task_email = {
"subject": "test email task",
"type": "EMAIL",
"priority_type": "HIGH",
"due": 11545245654
};
obj.contactAPI.createTaskByEmail("[email protected]",task_email, success, error);
- Task type accepeted value : CALL, EMAIL, FOLLOW_UP, MEETING, MILESTONE, SEND, TWEET, OTHER
- Task priority_type accepeted value : HIGH, NORMAL, LOW
- Task due accepeted value : epoch time in miliseconds
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
var update_task = {
"id": "5637588316585984",
"subject": "test updated",
"contacts": [
"5630286201094144"
],
"type": "EMAIL",
"priority_type": "HIGH",
"due": 11545245654
};
obj.contactAPI.updateTask(update_task, success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getTaskById('5766696644116480', success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.deleteTaskById('5766696644116480', success, error);
###5. Dynamic filter
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getContactsByPropertyFilter('Country','United State',success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getContactsByTagFilter('tester tag',success, error);
var AgileCRMManager = require("./agilecrm.js");
var obj = new AgileCRMManager("DOMAIN", "KEY", "EMAIL");
var success = function (data) {
console.log(data);
};
var error = function (data) {
console.log(data);
};
obj.contactAPI.getCompaniesByPropertyFilter('Custom Field Name','xyz120202',success, error);