1

我正在尝试通过 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 值传递时,它也不接受它。

4

2 回答 2

0

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

于 2020-11-13T16:45:49.007 回答
0

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

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

requests.post(url=self.url + '/fields/contact/new', headers=self.header, 
        data={
              'label': 'somelabel',
              'type': 'mautic data type',
              'properties[key]': 'value'
        })
于 2020-10-06T18:24:40.493 回答