Code Monkey home page Code Monkey logo

Comments (4)

priyankinfinnov avatar priyankinfinnov commented on August 14, 2024

+1 Needed.

from nodejs.

agilecrm avatar agilecrm commented on August 14, 2024

This will be taken up

from nodejs.

rammohan-agile avatar rammohan-agile commented on August 14, 2024

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.

from nodejs.

priyankinfinnov avatar priyankinfinnov commented on August 14, 2024

Really appreciate your fast action. Just in 1.5 years!
Thanks Again.

from nodejs.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.