Trello Rest API to get all Trello cards which user is able to View/Edit/Delete using Trello website

I have a requirement that to display all Trello cards for which user has permission to view/edit/delete. I have gone through Trello Rest API documentation  and found below API to get the Trello cards.

https://api.trello.com/1/members/me/cards?key=AppKey&token=AccessToken

But when I used this API, it returned the empty list though the user is admin/member for all boards and each board has few lists and cards. Then I have directly added same user as a member to one of the Trello card and executed the same API. This time it has returned the card to which I added user as member.

But I don't want to add user as a member to each card. As user is already admin/member of all boards I would like show all cards of all boards irrespective of whether user is a member of card or not. Is there any Trello rest API exists to fetch all cards for which user has permission to view/edit/delete?

Any suggestions/answers are more than welcome.

Thanks in advance!!!

1 answer

1 accepted

1 vote
Oscar Triscon Community Champion Nov 20, 2017

You need to iterate through the boards. First, get the boards for the member:

 

GET https://api.trello.com/1/members/me/boards?key=KEY&token=TOKEN

Then, for each board in the array:

GET https://api.trello.com/1/boards/BOARD_ID/cards?key=KEY&token=TOKEN

Thanks for your prompt response. If I implement as you suggested, then it leads to two any network calls(API calls). Out of curiosity I am asking, is there any single Trello API exists so that I can get all trello cards, instead of making multiple API calls?

Oscar Triscon Community Champion Nov 20, 2017

It actually leads to multiple API calls: one to get the member's boards and one for each board.

Further, each board may contain more cards than can be returned in one request. A request typically only returns up to 1000 cards. If you want to get all the cards for each board, you may need to perform multiple requests per board, using the before parameter (you can find it in the documentation).

There is no way to obtain all the cards for all boards in one single request, as this would potentially cause a tremendous amount of data to be transferred.

Suggest an answer

Log in or Join to answer
Community showcase
Bridget Sauer
Published Feb 02, 2018 in Trello

Atlassian User Groups: Trello edition

You’re invited to our first ever Trello User Groups   Good news for current and aspiring Trello enthusiasts! We’re launching Trello User Groups so that you can network, share ideas, solve ...

1,218 views 8 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot