Hi,
I’m having trouble and hoping someone can help me out or set me in the right direction.
I’m trying to have a form with an input field and submit button on my site. Then when someone enters text into the field, it will add a comment to a Trello Card.
I have my Trello API key and Token already.
I’ve looked at tons of examples but continue to get lost. Here’s a few sites I’ve checked:
http://www.trello.org/help.html
https://developers.trello.com/reference/#api-key-tokens
So I think the code should look something like this, but a lot is copy/paste, so I don’t totally understand what I’m doing:
Frontend:
import {putAddToCard} from ‘backend/aModule’;
$w.onReady(function () {
});
export function button1_click(event, $w) {
putAddToCard().then(resp => console.log(resp));
}
Backend:
import {fetch} from ‘wix-fetch’;
export function putAddToCard() {
const key = ‘’;
const token = ‘’;
const url = https://api.trello.com/1/lists/list-id/cards?idBoard?key=${key}&token=${token}
;
return fetch(url)
.then(resp => {
if (resp.ok) {
return resp.json();
}
})
.catch(err => console.log(err));
}
Thanks, I appreciate any help.