This is a wrapper for some of the Trello HTTP API. Please feel free to add any other pieces you need! :)
npm install trello
Log in to Trello and visit trello.com/app-key to get a token
and app key
. These need to be supplied when you create the Trello object (see below).
var Trello = require("trello");
var trello = new Trello("MY APPLICATION KEY", "MY USER TOKEN");
trello.addCard('Clean car', 'Wax on, wax off', myListId,
function (error, trelloCard) {
if (error) {
console.log('Could not add card:', error);
}
else {
console.log('Added card:', trelloCard);
}
});
API calls can either execute a callback or return a promise. To return a promise just omit the callback parameter.
//Callback
trello.getCardsOnList(listId, callback);
//Promise
var cardsPromise = trello.getCardsOnList(listId);
cardsPromise.then((cards) => {
//do stuff
})
// Get all registered tokens and webhooks
// Url will look like: https://api.trello.com/1/members/me/tokens?webhooks=true&key=YOURKEY&token=YOURTOKEN
trello.makeRequest('get', '/1/members/me/tokens', { webhooks: true })
.then((res) => {
console.log(res)
});
Everything that is not available as a function can be requested by calling makeRequest
.
getOrganization
restler
with needle
addCustomField
addOptionToCustomField
setCustomFieldOnCard
updateCardPos
delMemberFromCard
copyBoard
functionalitygetCustomFieldsOnBoard
getActionsOnBoard
getCardsOnBoardWithExtraParams
getCardsOnListWithExtraParams
addDueDateToCard
addCardWithExtraParams
makeRequest
getMember
getCardStickers
addStickerToCard
getOrgBoards
getMemberCards
updateBoardPref
addMemberToBoard
renameList
addChecklistToCard
getChecklistsOnCard
addExistingChecklistToCard
updateChecklist
getOrgMembers
addAttachmentToCard
addedrestler
dependencytrello_ex
merged again with original project trello
getBoards
added