在Infusionsoft中,有一个名为"Notes“的联系人字段,用于添加联系人的备注。我能够创建一个联系人,搜索或更新使用xml协议,Java.我试图以以下方式添加注释(下面的代码),但没有做到。
如何使用Java中的api为联系人添加Notes?
我的方法:
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)发布于 2017-11-09 06:53:30
我是从CompletionDate创建的输入软社区邮政中了解到的,添加了@Nicholas_Trecina字段并对我的代码做了一些更改。而且它是有效的。
editedVersion:
List params = new ArrayList();
Map noteData = new HashMap();
noteData.put("ContactId", contactId);
noteData.put("ActionDescription", "My Note Title");
noteData.put("isAppointment", 0);
noteData.put("ActionDate","20170803T08:00:00");
noteData.put("CompletionDate","20171109");
noteData.put("CreationNotes", "Note data- what i want to save as note: bla bla bla..");
params.add(api_key);
params.add("ContactAction");
params.add(noteData);
Integer responseCode = (Integer) client.execute(
"DataService.add", params);https://stackoverflow.com/questions/47171118
复制相似问题