0

I have a requirement to support forms of Oracle Eloqua Marketing Cloud Service in my project. I was testing the rest api for forms. So when I create form with single field using the create endpoint form is created in Eloqua CMS. But when I try to create form with Muliple fields it throws 500 InternalServerError.

Endpoint: REST/2.0/assets/form

Request Body: {
"name":"ELA_Form", "elements":[ { "type": "FormField", "name": "Address 1", "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}", "createdFromContactFieldId": "100006", "dataType": "text", "displayType": "text", "fieldMergeId": "36", "htmlName": "address1", "useGlobalSubscriptionStatus": "False", "validations": [] }, { "type": "FormField", "name": "Address 2", "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}", "createdFromContactFieldId": "100007", "dataType": "text", "displayType": "text", "fieldMergeId": "37", "htmlName": "address2", "useGlobalSubscriptionStatus": "False", "validations": [] } ], "processingType":"externalEmail" }

Response: Internal Server Error There was an internal server error. The error has been logged with log identifier 121363909. Please provide this log identifier to technical support.

Help would be appreciated!

1 Answers1

1

You need to set unique negative integers for the id for each field. Here is an example with them added that will result in successfully creating the form:

POST /API/REST/2.0/assets/form
{
  "name": "ELA_Form",
  "elements": [
    {
      "type": "FormField",
      "id": "-1",
      "name": "Address 1",
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "createdFromContactFieldId": "100006",
      "dataType": "text",
      "displayType": "text",
      "fieldMergeId": "36",
      "htmlName": "address1",
      "useGlobalSubscriptionStatus": "False",
      "validations": [

      ]
    },
    {
      "type": "FormField",
      "id": "-2",
      "name": "Address 2",
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "createdFromContactFieldId": "100007",
      "dataType": "text",
      "displayType": "text",
      "fieldMergeId": "37",
      "htmlName": "address2",
      "useGlobalSubscriptionStatus": "False",
      "validations": [

      ]
    }
  ],
  "processingType": "externalEmail"
}
loupatrick
  • 106
  • 4