如何使用Trello API检测清单项的状态

时间:2012-08-22 05:05:31

标签: trello

我希望在此表单中的查询返回的清单对象中的每个项目上看到某种“状态”字段:

https://api.trello.com/1/checklists/[checklist_id]

# Response:

{u'checkItems': [{u'id': u'blahblahblah1',
                  u'name': u'Some checklist item',
                  u'pos': 424242,
                  u'type': u'check'},
                 {etc..}
]}

此外,似乎以下方法确实返回状态,但仅针对已完成的核对表项:

https://api.trello.com/1/cards/[card_id]/checkItemStates

# Response:

[{"idCheckItem":"blahblahblah1","state":"complete”},
 {“idCheckItem":"blahblahblah2","state":"complete"},
 {"idCheckItem":"blahblahblah3","state":"complete”},
 {“idCheckItem":"blahblahblah4","state":"complete"}]

这是否意味着必须合成多个查询的结果才能准确查看给定卡上所有清单的状态?我希望在单个查询中获取卡上所有清单(包括每个项目的状态)的所有信息。我错过了什么吗?

1 个答案:

答案 0 :(得分:1)

如果您将/checkItems开关添加到路径,您将看到每个项目的状态:

/1/checklists/[checkListId]/checkitems?key=[your appKey]

返回:

[
    {"state":"complete","id":"XXX","name":"hex support","pos":16804},
    {"state":"incomplete","id":"XXX","name":"funky chars","pos":33233}
]

他们已经将它添加到基本调用(就像你拥有它一样)。