javascript-api
javascript-api copied to clipboard
add_deal returning 204 (no response data) and not creating the deal
#code `function createContact() { var email_received = document.getElementById('email').value; var contact = {}; contact.email = email_received; contact.first_name = document.getElementById('f_name').value; contact.last_name = document.getElementById('l_name').value; contact.company = "abc corp"; contact.title = "lead"; contact.phone = "+1-541-754-3010"; contact.website = "http://www.example.com"; var address = {"city": "new delhi", "state": "delhi", "country": "india"}; contact.address = JSON.stringify(address); contact.tags = "tag1, tag2"; // Custom fields can be added to contact object as contact.status = "incomplete"; contact.custom_id = "EN001C";
_agile.create_contact(contact, {
success: function (data) {
// Set Email at success of contact creation. But you can set it at failure too.
_agile.set_email(email_received);
console.log("CONTACT success");
var deal = {};
deal.name = "Test Deal";
deal.description = "This is a test deal";
deal.expected_value = "10000";
deal.milestone = "Target";
deal.probability = "95";
deal.close_date = "1514160000"; // Epoch time
_agile.add_deal(deal, {
success: function (data) {
console.log("success");
},
error: function (data) {
console.log("error");
}
});
},
error: function (data) {
console.log("error");
console.log("Error Cause = "+data);
}
});
// Function end
}`
Contact was created though!
Same for me. Contact is created and set_email worked. When I try to create the deal I get 204 response and no errors but I can't see the deal on the dashboard
Same issue for me, any ideas @graut
same here
Same here. Any news on that? Someone found a solution?
HI All, Thanks for using Agile CRM , We Fixed the issue moved to production .
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.