问题描述
我正在尝试获取分配给特定用户的板卡中的所有卡片,但以下返回板卡中的所有卡片.
I'm trying to get all cards in a board assigned to a specific user, but the below returns all the cards in a board.
我在任何地方都没有找到这个解决方案;这是我尝试过的,它返回分配给所有用户的卡片:
I did not find this solution anywhere; this is what I tried, and it returns cards assigned to all users:
https://api.trello.com/1/boards/${boardid}/cards?fields=name,shortLink&key=${applicationkey}&token=${userkey}
- ${boardid} = 我想要来自 的卡片的董事会 ID
- ${applicationkey} = Trello 开发者 API 密钥
- ${userkey} = Trello 用户令牌
- ${boardid} = id of the board I want cards from
- ${applicationkey} = Trello Developer API Key
- ${userkey} = Trello User Token
- ${applicationkey} = 开发者 API 密钥
- ${userkey} = 用户令牌
- ${boardname} = Trello 中板的实际名称
- ${memberid} = Trello 用户的成员 ID
看起来很多人都能够做到这一点,但没有关于这一点的工作文档.
Looks like a lot of people were able to do this, but there is no working documentation on this one.
推荐答案
通过使用 Trello 搜索 API,我能够完成此任务(获取分配给我的所有卡片).
I was able to accomplish this (get all cards assigned to me), by using the Trello search API.
查询网址(分配给会员的卡片):
https://api.trello.com/1/search?query=label:green%20member:${memberid}%20board:${boardname}%20sort:edited&card_fields=name,shortLink&cards_limit=100&key=${applicationkey}&token=${用户密钥}
查询模式(读取卡片的正则表达式):
"name":"({Description}.+?)","shortLink":"({Id}.+?)"
使用的参数:
获取开发者 API 密钥和用户令牌: 单击此处
从这里获取会员 ID:
https://api.trello.com/1/search?query=is:open%20board:${boardname}%20sort:edited&card_fields=name,shortLink,member&cards_limit=100&key=APIKey&token=UserToken
这篇关于Trello API:在特定板上获取分配给用户的所有卡片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!