[英]Eloqua integration via REST API using JAVA
Contact standard fields like First Name, Last Name and Email Address have been set via java and integrated using Rest API. 联系人标准字段(例如“名字”,“姓氏”和“电子邮件地址”)已通过java进行了设置,并使用Rest API进行了集成。
.NET code is below: .NET代码如下:
var customObject = new CustomObject
{
id = -10001,
name = "Disruption",
fields = new List<CustomObjectField>
{
new CustomObjectField
{
name = "FlightNumber",
dataType = Enum.GetName(typeof(DataType), DataType.text),
type = "CustomObjectField"
},
new CustomObjectField
{
name = "FlightDate",
dataType = Enum.GetName(typeof(DataType), DataType.text),
type = "CustomObjectField"
},
new CustomObjectField
{
name = "DisruptionType",
dataType = Enum.GetName(typeof(DataType), DataType.text),
type = "CustomObjectField"
},
new CustomObjectField
{
name = "EmailAddress",
dataType = Enum.GetName(typeof(DataType), DataType.text),
type = "CustomObjectField"
}
}
};
Just create a class representing your data with Java (using ArrayList for JSON arrays): 只需使用Java创建一个表示您的数据的类(将ArrayList用于JSON数组):
For your field: 针对您的领域:
public class customObjectField {
private String FlightNumber;
private String FlightDate;
...
}
For your object: 对于您的对象:
public class customObject {
private int id;
private String name;
private arrayList<customObjectField> fields;
}
Instantiate then serialize with gson. 实例化然后使用gson进行序列化。 Then post the String. 然后发布字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.