How to call the API at a more granular level? (eg. Cards in List from Member?)

Matt Cheah May 21, 2018

I'm trying to figure out how to call the API to specifically get a list of cards in a list from a member, assuming I already have the IDs for the lists and members. 
Logically it should look something like this: `https://api.trello.com/1/members/{id}/list/{id}/cards/`

But that doesn't work and it doesn't look like there's any info in the doc to support that multiple 'nestings' are possible. I saw another thread here: https://community.atlassian.com/t5/Trello-questions/Trello-Rest-API-to-get-all-Trello-cards-which-user-is-able-to/qaq-p/675426 in which a user wanted to find one endpoint that would give them all the cards in all the boards accessible by a user, and was unable to do so in one query. In this situation however, I'm trying to get significantly less data than I can get just by hitting `https://api.trello.com/1/members/{id}/cards` so it would make sense to give an option to retrieve data at a more granular scale. 

Is there a way to do this that I haven't seen? Thanks for the help!

1 answer

1 accepted

0 votes
Answer accepted
bentley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2018

Hey Matt,

There isn't a route that provides that granular of filtering. I think the closest you can get is going to be making a request to 1/members/{idMember}/cards and asking for the idField:

https://api.trello.com/1/members/{idMember}/cards?fields=idList

Then you'll have to do some parsing on your end to narrow it down to the list you want.

Matt Cheah May 23, 2018

Thanks Bentley, 

I ended up using boards/{id}/cards?fields=idList and went through several nested for loops to sort them into the right place. I made sure to add snarky comments in my code all the way through so that people wouldn't judge me as much if they happened to read the code. Thanks for your response!


octavient January 15, 2021

@bentleyIs this still true today?  I have a similar need.  If it's still true today, is this kind of thing on your API roadmap, at all? 

When integrating with 3rd-party integration services, like Integromat, we're exposed to extra cost when the API returns a lot of data that we're just throwing away.  Any insights here?

bentley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2021

Nothing has changed on the API front.

I can't think of a way at getting at this data without getting back _some_ data that you won't need. You'll get back a lot less data by asking only for specific fields and then making additional queries to get more fields.

You might also try asking in the developer community (https://community.developer.atlassian.com/c/trello) but I'm not sure that there is a better answer.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events