Create form data for a single form

post

/api/REST/2.0/data/form/{id}

Creates form data for the form that matches the criteria specified by the request body. This endpoint will only create form data that is specified in the request body. If a form field contains a static value, the field must be included in the request body to update the static value.

Request

Supported Media Types
Path Parameters
Body ()
The request body defines the details of the form data to be created.
Root Schema : FormData
Type: object
Title: FormData
Show Source
Nested Schema : fieldValues
Type: array
A list of key/value pairs identifying the form data (field name / value)
Show Source
Nested Schema : processingStepErrors
Type: array
A list of Processing Step Errors occurred in current form submission. This is a read-only property
Show Source
Nested Schema : validationErrors
Type: array
Validation errors if any occured in form submission. This is a read-only property
Show Source
Nested Schema : FieldValue
Type: object
Title: FieldValue
Show Source
Nested Schema : ProcessingStepError
Type: object
Title: ProcessingStepError
Show Source
Nested Schema : ObjectValidationError
Type: object
Title: ObjectValidationError
Show Source
Nested Schema : ObjectKey
Type: object
Title: ObjectKey
Show Source
Nested Schema : Requirement
Type: object
Title: Requirement
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : FormData
Type: object
Title: FormData
Show Source
Nested Schema : fieldValues
Type: array
A list of key/value pairs identifying the form data (field name / value)
Show Source
Nested Schema : processingStepErrors
Type: array
A list of Processing Step Errors occurred in current form submission. This is a read-only property
Show Source
Nested Schema : validationErrors
Type: array
Validation errors if any occured in form submission. This is a read-only property
Show Source
Nested Schema : FieldValue
Type: object
Title: FieldValue
Show Source
Nested Schema : ProcessingStepError
Type: object
Title: ProcessingStepError
Show Source
Nested Schema : ObjectValidationError
Type: object
Title: ObjectValidationError
Show Source
Nested Schema : ObjectKey
Type: object
Title: ObjectKey
Show Source
Nested Schema : Requirement
Type: object
Title: Requirement
Show Source

400 Response

Bad request. See Status Codes for information about other possible HTTP status codes.

401 Response

Unauthorized. See Status Codes for information about other possible HTTP status codes.

403 Response

Forbidden. See Status Codes for information about other possible HTTP status codes.

404 Response

The requested resource was not found. See Status Codes for information about other possible HTTP status codes.

500 Response

The service has encountered an error. See Status Codes for information about other possible HTTP status codes.
Back to Top

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
			
Back to Top