在infusionsoft CRM 中,有一个名为“Notes”的联系人字段,用于为联系人添加注释。我能够使用 xml-rpc 协议、java 创建联系人、搜索或更新。我尝试通过以下方式添加注释(我的代码如下)但不能。有人可以帮我了解如何在 java 中使用他们的 api 为联系人添加注释吗?
我的方法:
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
XmlRpcClient client = new XmlRpcClient();
config.setServerURL(new URL(uri)); //my app uri
client.setConfig(config);
List params=new ArrayList();
List customField=new ArrayList();
customField.add("this is new text1\n");
customField.add("this is text2\n");
customField.add("text3\n");
customField.add("text4\n");
params.add(api_key);
params.add("ContactNotes");//found from contact Table-schema
params.add(customField);
params.add(contactId); //suppose that was an known contactId Integer.
Integer responseCode=(Integer) client.execute("ContactService.add", params);
执行代码,它给出了这个错误:
org.apache.xmlrpc.XmlRpcException: No method matching arguments: java.lang.String, java.lang.String, [Ljava.lang.Object;, java.lang.Integer
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at infusionsoft.ContactOperation.addNote(ContactOperation.java:123)
at infusionsoft.Main.main(Main.java:80)