I am trying to create a contacts export in Eloqua following this tutorial.
The outcome I experience is:
HTTP/1.1 400 There was a validation error.
{
"failures": [{
"field": "name",
"constraint": "Must be a string value, at least 1 character and at most 100 characters long."
},
{
"field": "fields",
"constraint": "Is required."
}]
}
and makes no sense.
My requests are as follows:
POST https://<HOST>.eloqua.com/API/Bulk/2.0/contacts/exports
Request Body:
{
"name": "Sample Contacts Export",
"fields": {
"UniqueId": "{{Contact.Id}}",
"Subject": "{{Contact.Id}}",
"FirstName": "{{Contact.Field(C_FirstName)}}",
"LastName": "{{Contact.Field(C_LastName)}}",
"Email": "{{Contact.Field(C_EmailAddress)}}",
"Company": "{{Contact.Field(C_Company)}}",
"JobTitle": "{{Contact.Field(C_Title)}}",
"Address": "{{Contact.Field(C_Address1)}}",
"City": "{{Contact.Field(C_City)}}",
"Country": "{{Contact.Field(C_Country)}}",
"Province": "{{Contact.Field(C_State_Prov)}}",
"PostalCode": "{{Contact.Field(C_Zip_Postal)}}",
"Phone": "{{Contact.Field(C_BusPhone)}}",
"MobilePhone": "{{Contact.Field(C_MobilePhone)}}"
}
}
and
POST https://<HOST>.eloqua.com/API/Bulk/2.0/contacts/exports
Request Body:
{
"name":"Contact email export",
"fields":{
"EmailAddress":"{{Contact.Field(C_EmailAddress)}}"
}
}
The latter is actually the example from the tutorial.
Do you have any idea what's wrong?
Thanks in advance.
Your client might be including extra escape characters. Your definition is correct. Use a JSON formatter to validate the request body and copy+paste it to a program like fiddler and try it from there. I copy pasted the definition you posted and it works for me.