【问题标题】:Mautic Contact Field Api request returning 400 in responseMautic Contact Field Api 请求返回 400 作为响应
【发布时间】:2019-06-26 16:12:25
【问题描述】:

我正在尝试通过 api 在 mautic 中创建联系人字段并使用 oauth 2 进行身份验证。这是我得到的回应

{
    "errors": [
        {
            "code": 400,
            "message": "order: This value is not valid.",
            "details": {
                "order": [
                    "This value is not valid."
                ]
            }
        }
    ],
    "error": {
        "message": "order: This value is not valid. (`error` is deprecated as of 2.6.0 and will be removed in 3.0. Use the `errors` array instead.)",
        "code": 400,
        "details": {
            "order": [
                "This value is not valid."
            ]
        }
    }
}

我之前使用过 mautic api,并且从不需要 order 参数。此外,当我尝试将参数 order 作为 int 值传递时,它也不接受它。

【问题讨论】:

  • 我也有同样的问题,解决不了。

标签: symfony custom-fields mautic


【解决方案1】:

不确定这是否是您的问题的原因,但我使用 /fields/contacts/new 得到了相同的响应,并且路径实际上需要是 /fields/contact/new。

另外,我注意到您需要展平一些键,例如使用 properties 属性,您需要将键提交为 properties[key] - 见下文:

requests.post(url=self.url + '/fields/contact/new', headers=self.header, 
        data={
              'label': 'somelabel',
              'type': 'mautic data type',
              'properties[key]': 'value'
        })

【讨论】:

    【解决方案2】:

    我使用的是 Mautic 3.1,并且与 PHP mautic/api-library 有同样的问题。取消设置或不传递 order 属性可解决此问题。虽然,我不确定为什么它不接受 order 的值,因为我使用从 API 返回的相同值来获取字段定义(不更改值)。

    【讨论】:

      猜你喜欢
      • 2017-02-17
      • 2021-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 2020-06-16
      • 2019-12-18
      • 1970-01-01
      相关资源
      最近更新 更多