0

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?

  • Hi, first of all, I hope you are not including "Request body" in the request body ? As Eloqua is a SaaS, you have no access to error logs. This log identifier is the unique key for Oracle to retrieve logs in their database. It is useful when contacting Oracle support. – Clément Duveau Dec 08 '17 at 17:28
  • Hi Clement Duveau, No I am just passing the json in the request body. Do you have idea whats wrong in the json? – user1583865 Jul 13 '18 at 06:18
  • Hi, the error is not giving any information. The best way to debug is to contact Oracle support and give them the log identifier. They will give you the full stack trace. – Clément Duveau Jul 17 '18 at 08:53

1 Answers1

0

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": []
    }
  ]
}
Brydenr
  • 798
  • 1
  • 19
  • 30