You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
By following the instruction at https://developer.atlassian.com/cloud/trello/guides/embedding/embedding-cards/ (along with some digging through `embed.js` because embedding private cards requires providing a token, which is not documented), I was table to embed a test card within my web app.
The commenting form works just fine, but it's impossible to leave new comments. The issue is purely with the Trello embedding code - instead of sending `key` and `token` in the POST request to the comment API endpoint, it sends `data[key]` and `data[token]`, which results in HTTP 401. The reason it sends the data that way is because the code uses both `$.ajax` and `$.post` providing them with the same data - but those function require different inputs. Namely, `$.post` adds an extra wrapper around your input by putting it under that `data` key.
But even if that part is fixed, it still won't work because the code in `api.js` overrides the token by the value parsed from the cookie stored in the iframe. But AFAIK iframes don't have cookies nowadays - the token will always be `null`.