简体   繁体   English

无法使用 REST API for Oracle Eloqua Marketing Cloud Service 创建具有多个 FormField 的表单?

[英]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 .我正在测试用于使用POSTMAN创建表单的Oracle Eloqua Marketing Cloud Service方法的REST API REST API link . REST API 链接

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.您需要为字段 id 输入一个唯一的负整数。 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.如果成功,响应将包含新生成的 ID。

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": []
    }
  ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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