Skip to content

Instantly share code, notes, and snippets.

@htmlr
Last active March 31, 2016 13:50
Show Gist options
  • Select an option

  • Save htmlr/6dd8dffef476255259208a3a281d1e9b to your computer and use it in GitHub Desktop.

Select an option

Save htmlr/6dd8dffef476255259208a3a281d1e9b to your computer and use it in GitHub Desktop.
Trello - How to get cards for given list
/*
Include Client API
*/
<script src="https://api.trello.com/1/client.js?key=<api key>"></script>
<script>
var getListCards = function(){
/*
Note to get the List ID use Trello Sandbox examples to first get the relavent Board ID then in turn use this to get the relavent List ID (https://developers.trello.com/sandbox)
*/
Trello.get('/lists/<Card ID>/cards?fields=all&cards=open&card_fields=all&members=true',
function(successMsg){
console.log(successMsg);
},
function(errorMsg){
console.log(errorMsg);
}
);
}
/* Authorize */
Trello.authorize({
type: "popup",
name: "Get List Cards Example",
scope: {
read: true,
write: false },
expiration: "never",
success: getListCards,
error: function() { console.log("Failed authentication"); }
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment