简体   繁体   中英

Unable to create a form with multiple FormFields using REST API for Oracle Eloqua Marketing Cloud Service?

I am testing the REST API for Oracle Eloqua Marketing Cloud Service method for creating forms using POSTMAN . REST API link .

When I give single form field , form is getting created. this is my request:

POST /assets/form
Content-Type: application/json

But when I try to create form with multiple form fields like here:

  Request body: {
  "type": "Form",
  "createdAt": "1510563258",
  "createdBy": "9",
  "folderId": "7",
  "name": "Form with 3 fields_de-DE1254",
  "updatedAt": "1510563258",
  "elements": [
    {
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "type": "FormField",
      "name": "Æddrèëss 2",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "address2",
      "useGlobalSubscriptionStatus": "False",
      "validations": []
    },
    {
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "type": "FormField",
      "name": "Æddrèëss 3",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "address3",
      "useGlobalSubscriptionStatus": "False",
      "validations": []
    }
  ]
}

I get error:

Status : 500 InternalServerError

<html>
    <head>
        <title>Internal Server Error</title>
    </head>
    <body>
        <h1>
        Internal Server Error
    </h1>
        <div>
        There was an internal server error.
    </div>
        <div>
        The error has been logged with log identifier 
            <b>115451307</b>.
        </div>
        <div>
        Please provide this log identifier to technical support.
    </div>
    </body>
</html>

Please can someone help me with this? Also what is is this log identifier and where can I find it?

I just had this and got the solution from support. You need to put in a unique and negative integer for the field ids. After doing this, you can send in an array of form fields and they will all get processed in one call. The response will contain the newly generated ids, if successful.

Here's the modified snippet:

Request body: {
  "type": "Form",
  "createdAt": "1510563258",
  "createdBy": "9",
  "folderId": "7",
  "name": "Form with 3 fields_de-DE1254",
  "updatedAt": "1510563258",
  "elements": [
    {
      "id": "-1",
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "type": "FormField",
      "name": "Æddrèëss 2",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "address2",
      "useGlobalSubscriptionStatus": "False",
      "validations": []
    },
    {
      "id": "-2",
      "style": "{\"fieldSize\":\"large\",\"labelPosition\":\"top\"}",
      "type": "FormField",
      "name": "Æddrèëss 3",
      "dataType": "text",
      "displayType": "text",
      "htmlName": "address3",
      "useGlobalSubscriptionStatus": "False",
      "validations": []
    }
  ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM