将联系人添加到FreshSales CRM时出错

时间:2018-02-16 14:15:11

标签: javascript java spring-mvc

我正在尝试在我的Freshsales CRM中向Java Spring MVC Web Application添加新联系人。我在项目类路径中添加了FreshsalesAnalytics类所需的jar文件。我使用以下代码将联系人添加到新销售。

FreshsalesAnalytics freshsales = new FreshsalesAnalytics("URL", "TOKEN");
JSONObject newLead = new JSONObject();
newLead.put("First name", "John"); //Replace with first name of the user
newLead.put("Last name", "Doe"); //Replace with last name of the user
newLead.put("Email", "john.doe@example.com"); //Replace with email of the user
//newLead.put("fs_contact", true); if you want to create a contact
newLead.put("Alternate contact number", "98765432"); //Replace with custom field
JSONObject company = new JSONObject();
company.put("Name", "Example.com"); //Replace with company name
company.put("Website", "www.example.com"); //Replace with website of company
newLead.put("company", company);
String identifier = "john.doe@example.com"; //Replace with unique identifier
freshsales.identify(identifier, newLead);

但我在" freshsales.identify(identifier, newLead);"中收到错误。  在一个支持文档中,我看到我们可以使用"freshsales.set(identifier, newLead);",但在这里我无法使用set属性。

我在"" The type org.json.JSONObject cannot be resolved. It is indirectly referenced from required .class files"错误freshsales.identify(identifier,newLead);"`代码。  我怎样才能克服这个问题。任何帮助都非常感谢。

0 个答案:

没有答案