0

我无法使用 PYPODIO2 包装器和 API 在 PODIO 中创建项目。我已经能够使用 OAuth App Authentication 成功授权。下面是我试图执行的代码片段,但我遇到了错误

attributes={"fields": {"module-serial": serial_number,
                       "contract-manufacturer-name-2":"Extel",
                       "module-number-and-name":{ 
                                "status": "active",
                                "text": "BD201: Main Board Extended Build",
                                "id": 2},
                       "category":{
                               "status": "active",
                               "text": "Pass",
                               "id": 1}
                       }
            }

pcbapp.Item.create(17174065, attributes)

错误: pypodio2.transport.TransportException: TransportException({'server': 'nginx', 'date': 'Tue, 07 Feb 2017 05:49:05 GMT', 'content-type': 'application/json; charset= utf-8','content-length':'259','connection':'keep-alive','x-rate-limit-remaining':'989','x-rate-limit-limit':' 1000','x-podio-auth-ref':'app_17174065','x-podio-request-id':'yUWqV1ao','strict-transport-security':'max-age=31535999','status' : '400'}): {"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http://api.podio.com/item/app /17174065/","query_string":"","method":"POST"},"error_description":"无效值 null (null): Not a valid option","error":"invalid_value"}

错误描述:Invalid value null (null): Not a valid option

4

1 回答 1

1

很可能您的某个字段的格式错误。您应该尝试将它们一一填写以找到有问题的一个,然后为最后一个尝试不同的格式。

我建议您从类别字段开始module-number-and-namecategory传递以下值:

{
 ...........
 # passing array of id's only, without text and status
 "module-number-and-name" : [2], 
 "category" :               [1], 
 .........
}
于 2017-02-08T13:58:43.363 回答