Trello API: Get all Cards assigned to a user, on a specific board

此生再无相见时 提交于 2019-12-24 16:00:38

问题


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 of the board I want cards from
  • ${applicationkey} = Trello Developer API Key
  • ${userkey} = Trello User Token

Looks like a lot of people were able to do this, but there is no working documentation on this one.


回答1:


I was able to accomplish this (get all cards assigned to me), by using the Trello search API.

Query URL (Cards assigned to a member):

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=${userkey}

Query Pattern (regexp to read cards):

"name":"({Description}.+?)","shortLink":"({Id}.+?)"

Parameters used:

  • ${applicationkey} = Developer API Key
  • ${userkey} = User Token
  • ${boardname} = Actual name of the board in Trello
  • ${memberid} = member id of the Trello user

Get Developer API key and User Token: Click here

Get member id from here:

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



来源:https://stackoverflow.com/questions/50395252/trello-api-get-all-cards-assigned-to-a-user-on-a-specific-board

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!