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?
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
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.