Create form data for a single form
/api/rest/2.0/data/form/{id}
Request
- application/json
-
id(required): integer
The ID of the form
object
FormData
-
correlationId:
string
The unique identifier of form submission within the batch. Optional String field. If present, must be unique across created batches. If
correlationId
is not unique, then the entire batch will fail. ThecorrelationId
is persisted and could be used to identify the form submit. -
currentStatus:
string
The current status of the form submission job. Possible values: Queued, InProgress, Error, and Success.
-
fieldValues:
array fieldValues
A list of key/value pairs identifying the form data (field name / value)
-
id:
string
Read Only:
true
The ID of the form submit if synchronous or ID of the form submission job if asynchronous. This is a read-only property -
processedAt:
string
Unix timestamp for the date and time the form data was processed if submitted through asynchronous submission. This is a read-only property
-
processingStepErrors:
array processingStepErrors
A list of Processing Step Errors occurred in current form submission. This is a read-only property
-
rowId:
integer
In case of an asynchronous form submission if processed then submit ID of form submission. This is a read-only property
-
submittedAt:
string
Unix timestamp for the date and time the form data was submitted. This is a read-only property
-
submittedByContactId:
string
The ID of the contact that submitted the form. This is a read-only property
-
type:
string
The asset's type in Eloqua. This is a read-only property
-
validationErrors:
array validationErrors
Validation errors if any occured in form submission. This is a read-only property
array
-
Array of:
object FieldValue
Title:
FieldValue
array
-
Array of:
object ProcessingStepError
Title:
ProcessingStepError
array
-
Array of:
object ObjectValidationError
Title:
ObjectValidationError
object
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
name:
string
Name of the field value.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
object
ProcessingStepError
-
errorCode:
integer
Unique Error Code for current error
-
errorDescription:
string
Detailed information about current error
-
errorMessage:
string
Error message for current error code
-
processingStepDisplayName:
string
DisplayName of the processing step including description (if configured)
-
processingStepId:
string
Processing step id during which error ocurred
-
processingStepTypeId:
string
Type of the processing step during which error ocurred
-
type:
string
The asset's type in Eloqua.
object
ObjectValidationError
-
container:
object ObjectKey
Title:
ObjectKey
-
property:
string
-
requirement:
object Requirement
Title:
Requirement
-
type:
string
-
value:
string
object
ObjectKey
-
container:
object ObjectKey
Title:
ObjectKey
-
objectId:
string
-
objectType:
string
-
type:
string
Response
- application/json
201 Response
object
FormData
-
correlationId:
string
The unique identifier of form submission within the batch. Optional String field. If present, must be unique across created batches. If
correlationId
is not unique, then the entire batch will fail. ThecorrelationId
is persisted and could be used to identify the form submit. -
currentStatus:
string
The current status of the form submission job. Possible values: Queued, InProgress, Error, and Success.
-
fieldValues:
array fieldValues
A list of key/value pairs identifying the form data (field name / value)
-
id:
string
Read Only:
true
The ID of the form submit if synchronous or ID of the form submission job if asynchronous. This is a read-only property -
processedAt:
string
Unix timestamp for the date and time the form data was processed if submitted through asynchronous submission. This is a read-only property
-
processingStepErrors:
array processingStepErrors
A list of Processing Step Errors occurred in current form submission. This is a read-only property
-
rowId:
integer
In case of an asynchronous form submission if processed then submit ID of form submission. This is a read-only property
-
submittedAt:
string
Unix timestamp for the date and time the form data was submitted. This is a read-only property
-
submittedByContactId:
string
The ID of the contact that submitted the form. This is a read-only property
-
type:
string
The asset's type in Eloqua. This is a read-only property
-
validationErrors:
array validationErrors
Validation errors if any occured in form submission. This is a read-only property
array
-
Array of:
object FieldValue
Title:
FieldValue
array
-
Array of:
object ProcessingStepError
Title:
ProcessingStepError
array
-
Array of:
object ObjectValidationError
Title:
ObjectValidationError
object
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
name:
string
Name of the field value.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
object
ProcessingStepError
-
errorCode:
integer
Unique Error Code for current error
-
errorDescription:
string
Detailed information about current error
-
errorMessage:
string
Error message for current error code
-
processingStepDisplayName:
string
DisplayName of the processing step including description (if configured)
-
processingStepId:
string
Processing step id during which error ocurred
-
processingStepTypeId:
string
Type of the processing step during which error ocurred
-
type:
string
The asset's type in Eloqua.
object
ObjectValidationError
-
container:
object ObjectKey
Title:
ObjectKey
-
property:
string
-
requirement:
object Requirement
Title:
Requirement
-
type:
string
-
value:
string
object
ObjectKey
-
container:
object ObjectKey
Title:
ObjectKey
-
objectId:
string
-
objectType:
string
-
type:
string
400 Response
401 Response
403 Response
404 Response
500 Response
Examples
The following examples demonstrate how to create new form data using an HTTP request and cURL. For more information on requests, see API requests.
HTTP request example
Create some new form data for the form asset with ID #21:
POST /api/REST/2.0/data/form/21
Content-Type: application/json
Request body:
{
"type": "FormData",
"fieldValues": [
{
"type": "FieldValue",
"id": "1",
"name": "firstName",
"value": "John"
},
{
"type": "FieldValue",
"id": "2",
"name": "lastName",
"value": "www.oracle.com"
},
{
"type": "FieldValue",
"id": "3",
"name": "emailAddress",
"value": "<div>"
},
{
"type": "FieldValue",
"id": "4",
"name": "optInDate",
"value": "abc"
}
]
}
Response in case of success:
For brevity, only the successful form data submission was included in this response.
{
"type": "FormData",
"id": "236",
"fieldValues": [
{
"type": "FieldValue",
"id": "1",
"value": "John"
}
]
}
Response in case of failure (TextWithNoUrlRequirement):
Eloqua sends the following response when the form data contains a URL, and the form field validation PreventUrlCondition
is enabled. The response indicates the field does not allow text that contains a URL. See the Eloqua Help Center for more information on form field validation.
[
{
"type": "ObjectValidationError",
"container": {
"type": "ObjectKey",
"objectType": "FormData"
},
"property": "1",
"requirement": {
"type": "TextWithNoUrlRequirement"
},
"value": "www.oracle.com"
}
]
Response in case of failure (TextWithNoHtmlRequirement):
Eloqua sends the following response when the form data contains HTML, and the form field validation PreventXSSCondition
is enabled. The response indicates the field does not allow text that contains HTML. See the Eloqua Help Center for more information on form field validation.
[
{
"type": "ObjectValidationError",
"container": {
"type": "ObjectKey",
"objectType": "FormData"
},
"property": "1",
"requirement": {
"type": "TextWithNoHtmlRequirement"
},
"value": "<div>"
}
]
Response in case of failure (DateRequirement):
Eloqua sends the following response when the form data does not contain a date, and the form field validation IsDateCondition
is enabled. The response indicates the field must contain a date. See the Eloqua Help Center for more information on form field validation.
[
{
"type": "ObjectValidationError",
"container": {
"type": "ObjectKey",
"objectType": "FormData"
},
"property": "4",
"requirement": {
"type": "DateRequirement"
},
"value": "abc"
}
]
cURL example
Here is the same example in cURL given an instance with the name APITest
, username API.User
, and pod of 3
.
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"type":"FormData","fieldValues":[{"type":"FieldValue","id":"1","name":"firstName","value":"John"},{"type":"FieldValue","id":"2","name":"lastName","value":"www.oracle.com"},{"type":"FieldValue","id":"3","name":"emailAddress","value":"<div>"},{"type":"FieldValue","id":"4","name":"optInDate","value":"abc"}]}' https://secure.p03.eloqua.com/api/rest/2.0/data/form/21