How to do first fetch? finding cards in a board

I am not a junior developer. I have worked with APIs before. This just has a heck of a learning curve at the start.

I think I have created the keys and such that I need. I have:

 token: AAAAAA
 
 Added allowed origin:
 http://localhost:3000
 
 Power-Up: first-KA
 workspace: KA
 API key: BB
 allowed origins: http://localhost:3000
 secret: CCCC
 
 Power-Up: first-RK
 workspace: RK
 API key: DD
 allowed origins: http://localhost:3000
 secret: EEEE

I am trying to do:

 curl --request GET  --url 'https://api.trello.com/1/boards/1/lists?key=APIKey&token=APIToken' \
 --header 'Accept: application/json'

Since the board is in the RK workspace, I use DD as the APIKey and AAAA as the token. Got the response: “invalid key”

So what the heck is the valid key? And what is a valid board id? Where do I find the id for a board?

It seems that there is an obvious heirarchy here. At the top is the Workspace. Then you have Boards. Then you have Lists. Then you have Cards. Maybe the Account is above the Workspace?

So, where is the call to ask someone (a workspace, an account) for a list of the boards so that I will have the ids of the boards?

I need some id of something at the top of the heirarchy to ask for the things below it, yes? Where is the call to the top object that takes only your auth information and gives you the objects at the top of the heirarchy? What am I missing?

Much thanx for any suggestions.

Wow. No ideas?

Is there a simpler way to do this? I am trying to get a list of my cards across a number of boards. I use lists in all of the boards for “To Do”, “Doing”, and “Done”. I would like a list of the card titles of all of the “Doing” lists. Is this possible in some other way? If using the API is not actually possible?

It is quite complicated to start with, I can give a few pointers that helped me with power-ups:

APIKey: this comes from the power-ups/admin page for you app under ‘Api Key’ and then there’s a field ‘Api key’.

Getting Board ID: there’s a few ways I believe but I find this easiest is through the functions for example:
‘card-badges’: (t: any, opts: any) => {
boardID = opts.context.board;


}

From this you can call the board endpoint which will return idOrganization as field which will allow you to get workspace information.

Token: I assume you already have the token but if not look here under Authenticate Your User: Getting Started with client.js

For your query of getting all card titles within all doing lists on the board:
-use boardId to get board object containing workspace id
-use workspace id to get all board ids
-foreach board id get board lists / doing lists (if hard coding)
-aggregate all of the ‘doing’ lists / select titles

send a message if you’d like additional info :+1:

See this video on API keys and Tokens: https://www.youtube.com/watch?v=ndLSAD3StH8 (to be sure you have the right ones)

And then this for ids: https://www.youtube.com/watch?v=es84INLIiKI

Then jump here to get going: https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/

[If you use C# for programming language I can recommend this: NuGet Gallery | TrelloDotNet 2.0.5

The first video was very helpful. I did not realize, I think, that I did not need to create a power-up. Doing so, at least at the start, complicates things.

This was helpful and I can now fetch what I want.

1 Like