Create a form

post

/api/REST/1.0/assets/form

Creates a form that matches the criteria specified by the request body. Note: You can also create a form via REST 2.0 by using the endpoint REST/2.0/assets/form.

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 : elements
Type: array
Array consisting of form elements.
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 : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : Form
Type: object
Title: Form
Show Source
Nested Schema : elements
Type: array
Array consisting of form elements.
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 : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
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

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


POST /api/REST/1.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": "103",
  "createdAt": "1587563155",
  "createdBy": "9",
  "depth": "complete",
  "folderId": "7",
  "name": "New Email Form",
  "permissions": "fullControl",
  "updatedAt": "1587563155",
  "updatedBy": "9",
  "archived": "false",
  "elements": [
    {
      "type": "FormField",
      "id": "672",
      "name": "Favorite color.",
      "style": "{",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "favCol",
      "validations": []
    }
  ],
  "emailAddressFormFieldId": "672",
  "isHidden": "false",
  "processingSteps": [],
  "processingType": "externalEmail"
}
			
Back to Top