Closed nikunjve closed 5 years ago
+1 Needed.
This will be taken up
Hi @nikunjve , @priyankinfinnov Thanks for using AGILE CRM , Please use below function to update Lead score This will solve your problem
// update lead score
ContactAPI.prototype.update_lead = function update_lead(contact, success, failure) { var options = this.getOptions(); options.path = '/dev/api/contacts/edit/lead-score'; options.method = 'PUT'; options.headers['Content-Type'] = 'application/json';
var put = https.request(options, function(resp) {
resp.setEncoding('utf8');
var body = "";
resp.on('data', function(data) {
body += data;
});
resp.on('end', function() {
if (success) {
try {
console.log("Status Code = " + resp.statusCode);
var statusCode = resp.statusCode;
if (statusCode != 200){
console.log("Error message = " + body);
}
try {
var contacts = JSON.parse(body);
success(contacts);
} catch (e) {
return body;
}
} catch (ex) {
failure(ex);
}
}
});
resp.on('error', function(e) {
if (failure) {
failure(e);
}
});
});
try {
var data = JSON.stringify(contact);
put.write(data);
put.end();
} catch (ex) {
failure(ex);
}
}; Hope This will Help You , In case you need more information regarding Agile CRM REST API please check below main reference :
https://github.com/agilecrm/rest-api
Thanks, Agile crm support team.
Really appreciate your fast action. Just in 1.5 years! Thanks Again.
Please add a method to update lead score. Other methods don't work for it.