Trello API: getting boards / lists / cards information

前端 未结 5 1259
余生分开走
余生分开走 2021-02-03 22:12

Using Trello API: - I\'ve been able to get all the cards that are assigned to a Trello user - I\'ve been able to get all the boards that are assigned to an Organization

5条回答
  •  攒了一身酷
    2021-02-03 22:52

    Here is a quick and dirty bash script using curl and jq to get any given Board's ID or List's Id:

    key=""
    token=""
    trelloUsername=""
    boardName=""
    listName=""
    
    boardID=$(curl -s --request GET --url "https://api.trello.com/1/members/$trelloUsername/boards?key=$key&token=$token" --header 'Accept: application/json' | jq -r ".[] | select(.name == \"$boardName\").id")
    echo "boardID: ${boardID}"
    listID=$(curl -s --request GET --url "https://api.trello.com/1/boards/$boardID/lists?key=$key&token=$token" | jq -r ".[] | select(.name == \"$listName\").id")
    echo "listID: ${listID}"
    

    Example output:

    boardID: 5eab513c719d2d681bafce0e
    listID: 5eab519e66dd4272gb720e22
    

提交回复
热议问题