Create form data in batch for a single form

post

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

Creates form data in batch for the form that matches the criteria specified by the request body. This endpoint will only create all form data specified in the request body.

Request

Supported Media Types
Path Parameters
Query Parameters
  • Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth: minimal, partial, and complete. Any other values passed are reset to complete by default. For more information, see Request depth.
Body ()
The request body defines the details of the form data in a batch to be created.
Root Schema : AsyncFormSubmissionBatch
Type: object
Title: AsyncFormSubmissionBatch
Show Source
Nested Schema : elements
Type: array
A list of form data elements
Show Source
Nested 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 : AsyncFormSubmissionBatch
Type: object
Title: AsyncFormSubmissionBatch
Show Source
Nested Schema : elements
Type: array
A list of form data elements
Show Source
Nested 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 in a batch using an HTTP request and cURL. For more information on requests, see API requests.

HTTP request examples

Using a batchCorrelationId to identify the batch, create new form data in a batch for the form asset with ID #3 at complete depth:


POST /api/REST/2.0/data/form/3/batch?depth=complete
Content-Type: application/json 
			

Request body:


{
  "callbackUrl": "https://www.oracle.com",
  "batchCorrelationId": "BBB61C0B-8B95-4050-8D0F-11A0587E50EF",
  "formData": [
    {
      "correlationId": "BBB61C0B-8B95-4050-8D0F-12A0587E50EF",
      "fieldValues": [
        {
          "type": "FieldValue",
          "id": "1",
          "name": "firstName",
          "value": "John"
        },
        {
          "type": "FieldValue",
          "id": "2",
          "name": "lastName",
          "value": "Snow"
        },
        {
          "type": "FieldValue",
          "id": "13",
          "name": "Salesperson",
          "value": "Sales@oracle.com"
        }
      ]
    }
  ]
}
			

Response in case of success and no validation errors:


{
  "type": "AsyncFormSubmissionBatch",
  "id": "2",
  "callbackUrl": "https://www.oracle.com",
  "created": [
    {
      "type": "FormData",
      "currentStatus": "Success",
      "id": "15",
      "fieldValues": [
        {
          "type": "FieldValue",
          "id": "1",
          "name": "firstName",
          "value": "John"
        },
        {
          "type": "FieldValue",
          "id": "2",
          "name": "lastName",
          "value": "Snow"
        },
        {
          "type": "FieldValue",
          "id": "13",
          "name": "Salesperson",
          "value": "Sales@oracle.com"
        }
      ],
      "submittedAt": "1604932720",
      "correlationId": "bbb61c0b-8b95-4050-8d0f-12a0587e50ef"
    }
  ],
  "depth": "complete"
}
			

Without a batchCorrelationId to identify the batch, create new form data in a batch for the form asset with ID #3 at minimal depth:


POST /api/REST/2.0/data/form/3/batch?depth=minimal
Content-Type: application/json 
			

Request body:


{
  "callbackUrl": "https://www.oracle.com",
  "formData": [
    {
      "correlationId": "BBB61C0B-8B95-4050-8D0F-12A0587E50EF",
      "fieldValues": [
        {
          "type": "FieldValue",
          "id": "1",
          "name": "firstName",
          "value": "John"
        },
        {
          "type": "FieldValue",
          "id": "2",
          "name": "lastName",
          "value": "Snow"
        },
        {
          "type": "FieldValue",
          "id": "13",
          "name": "Salesperson",
          "value": "Sales@oracle.com"
        }
      ]
    }
  ]
}
			

Response in case of success and no validation errors:


{
  "type": "AsyncFormSubmissionBatch",
  "id": "4",
  "callbackUrl": "https://www.oracle.com",
  "created": [
    {
      "type": "FormData",
      "id": "17",
      "correlationId": "bbb61c0b-8b95-4050-8d0f-12a0587e50ef"
    }
  ],
  "depth": "minimal"
}
			

Create new form data in a batch for the form asset with ID #3, without a batchCorrelationId or correlationId:


POST /api/REST/2.0/data/form/3/batch
Content-Type: application/json 
			

Request body:

In the request we are specifying invalid form data for the FieldValue with ID 13.


{
  "callbackUrl": "https://www.oracle.com",
  "formData": [
    {
      "fieldValues": [
        {
          "type": "FieldValue",
          "id": "1",
          "name": "firstName",
          "value": "John"
        },
        {
          "type": "FieldValue",
          "id": "2",
          "name": "lastName",
          "value": "Snow"
        },
        {
          "type": "FieldValue",
          "id": "13",
          "name": "address",
          "value": "Thisfieldistoolongandshouldfailbecauseofavalidationerror"
        }
      ]
    }
  ]
}
			

Response in case of success, with validation errors:


{
  "type": "AsyncFormSubmissionBatch",
  "callbackUrl": "https://www.oracle.com",
  "depth": "complete",
  "errors": [
    {
      "type": "FormData",
      "currentStatus": "Error",
      "fieldValues": [
        {
          "type": "FieldValue",
          "id": "1",
          "name": "firstName",
          "value": "John"
        },
        {
          "type": "FieldValue",
          "id": "2",
          "name": "lastName",
          "value": "Snow"
        },
        {
          "type": "FieldValue",
          "id": "13",
          "name": "address",
          "value": "Thisfieldistoolongandshouldfailbecauseofavalidationerror"
        }
      ],
      "validationErrors": [
        {
          "type": "ObjectValidationError",
          "container": {
            "type": "ObjectKey",
            "objectType": "FormData"
          },
          "property": "13",
          "requirement": {
            "type": "ValidTextLengthRequirement"
          },
          "value": "Thisfieldistoolongandshouldfailbecauseofavalidationerror"
        }
      ]
    }
  ]
}
			

cURL example

Here is the first 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 '{"callbackUrl":"https://www.example.com","batchCorrelationId":"BBB61C0B-8B95-4050-8D0F-11A0587E50EF","formData":[{"correlationId":"BBB61C0B-8B95-4050-8D0F-12A0587E50EF","fieldValues":[{"type":"FieldValue","id":"1","name":"firstName","value":"John"},{"type":"FieldValue","id":"2","name":"lastName","value":"Snow"},{"type":"FieldValue","id":"13","name":"Salesperson","value":"Sales@oracle.com"}]}]}' https://secure.p03.eloqua.com/api/rest/2.0/data/form/3/batch
			
Back to Top