Create a form

post

/api/REST/2.0/assets/form

Creates a form that matches the criteria specified by the request body.

Request

Supported Media Types
Body ()
The request body defines the details of the form to be created.
Root Schema : Form
Type: object
Title: Form
Show Source
Nested Schema : FormFieldUpdateMapping
Type: object
Title: FormFieldUpdateMapping
Show Source
Nested Schema : elements
Type: array
Array consisting of form elements.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form granted to your current instance. This is a read-only property.
Show Source
Nested Schema : processingSteps
Type: array
A list of the form's processing steps. There is no limit to the number of processing steps that can be included. Possible values include: FormStepAddToCampaign, FormStepAddToContactList, FormStepAddToDataCanvas, FormStepAddToProgram, FormStepAssociateToCampaign, FormStepCancelRegistration, FormStepUpdateContactEmailAddress, FormStepCreateUpdateEventRegistration, FormStepCreateUpdate, FormStepCreateUpdateFromFormField, FormStepGlobalSubscribe, FormStepGlobalUnsubscribe, FormStepGroupSubscription, FormStepPostData, FormStepRedirectToWebPage, FormStepRemoveFromContactList, FormStepRunIntegrationRules, FormStepSendEmail, FormStepSendNotificationEmail, and FormStepWebTracking.
Show Source
Nested Schema : Size
Type: object
Title: Size
Show Source
Nested Schema : permissions
Type: array
The permissions for the form field update mapping granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : permissions
Type: array
The permissions for the form element granted to your current instance.
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
Show Source
Nested Schema : ProcessingStepCondition
Type: object
Title: ProcessingStepCondition
Show Source
Nested Schema : permissions
Type: array
The permissions for the form processing step granted to your current instance.
Show Source
Nested Schema : conditionalFieldCriteria
Type: array
The conditional field criteria for the form processing step condition.
Show Source
Nested Schema : FieldComparisonCriteria
Type: object
Title: FieldComparisonCriteria
Show Source
Nested Schema : Condition
Type: object
Title: Condition
Show Source
Nested Schema : permissions
Type: array
The permissions for the field comparison criteria granted to your current instance. This is a read-only property.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : Form
Type: object
Title: Form
Show Source
Nested Schema : FormFieldUpdateMapping
Type: object
Title: FormFieldUpdateMapping
Show Source
Nested Schema : elements
Type: array
Array consisting of form elements.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form granted to your current instance. This is a read-only property.
Show Source
Nested Schema : processingSteps
Type: array
A list of the form's processing steps. There is no limit to the number of processing steps that can be included. Possible values include: FormStepAddToCampaign, FormStepAddToContactList, FormStepAddToDataCanvas, FormStepAddToProgram, FormStepAssociateToCampaign, FormStepCancelRegistration, FormStepUpdateContactEmailAddress, FormStepCreateUpdateEventRegistration, FormStepCreateUpdate, FormStepCreateUpdateFromFormField, FormStepGlobalSubscribe, FormStepGlobalUnsubscribe, FormStepGroupSubscription, FormStepPostData, FormStepRedirectToWebPage, FormStepRemoveFromContactList, FormStepRunIntegrationRules, FormStepSendEmail, FormStepSendNotificationEmail, and FormStepWebTracking.
Show Source
Nested Schema : Size
Type: object
Title: Size
Show Source
Nested Schema : permissions
Type: array
The permissions for the form field update mapping granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : permissions
Type: array
The permissions for the form element granted to your current instance.
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
Show Source
Nested Schema : ProcessingStepCondition
Type: object
Title: ProcessingStepCondition
Show Source
Nested Schema : permissions
Type: array
The permissions for the form processing step granted to your current instance.
Show Source
Nested Schema : conditionalFieldCriteria
Type: array
The conditional field criteria for the form processing step condition.
Show Source
Nested Schema : FieldComparisonCriteria
Type: object
Title: FieldComparisonCriteria
Show Source
Nested Schema : Condition
Type: object
Title: Condition
Show Source
Nested Schema : permissions
Type: array
The permissions for the field comparison criteria granted to your current instance. This is a read-only property.
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 forms using an HTTP request and cURL. For more information on requests, see API requests.

HTTP Request Example

Create a new external email form asset including one new form field:


POST /api/REST/2.0/assets/form
Content-Type: application/json 
			

Request body:


{    
   "name":"New Email Form",
   "elements":[
        {
            "type":"FormField",
            "name":"Favorite color.",
            "style":"{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
            "dataType":"text",
            "displayType":"text",
            "htmlName":"favCol"
            ],
  "processingType":"externalEmail",
}
			

Response:


{
  "type": "Form",
  "currentStatus": "Draft",
  "id": "61",
  "createdAt": "1534799062",
  "createdBy": "11",
  "depth": "complete",
  "folderId": "7",
  "name": "New Email Form",
  "permissions": [
    "Retrieve",
    "SetSecurity",
    "Delete",
    "Update"
  ],
  "updatedAt": "1534799062",
  "updatedBy": "11",
  "archived": "false",
  "elements": [
    {
      "type": "FormField",
      "id": "355",
      "name": "Favorite color.",
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "favCol",
      "useGlobalSubscriptionStatus": "False",
      "validations": [
        
      ]
    }
  ],
  "processingSteps": [],
  "processingType": "externalEmail"
}
			

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 '{"name":"New Email Form","elements":[{"type":"FormField","name":"Favorite color.","style":"{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}","dataType":"text","displayType":"text","htmlName":"favCol"],"processingType":"externalEmail",}' https://secure.p03.eloqua.com/api/rest/2.0/assets/form
			
Back to Top