Last active
March 24, 2016 15:35
-
-
Save reganstarr/7b57ffa71fc0df854dcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*To get the Trello checklist ID... | |
1. Open the card that contains the checklist | |
2. In the right sidebar of the card, click on "Share and more" | |
3. Click "Export JSON" | |
4. Select all of that JSON and Copy it to your clipboard | |
5. Go to http://www.jsoneditoronline.org/ | |
6. Paste in the JSON in the box on the left | |
7. Click the right arrow [>] button | |
8. On the right side, scroll down until you see the "checklists" key, then click the arrows to expand that section | |
9. Use the "name" key find the correct checklist, then copy the "id" value of that checklist | |
*/ | |
var trelloChecklistId = ""; | |
// To get this, go to https://trello.com/app-key | |
var trelloApiKey = ""; | |
// To get this, go to https://trello.com/app-key, find where it says, "you can manually generate a Token" and click on the "Token" link. | |
var trelloToken = ""; | |
var checklistItemName = "name=" + encodeURIComponent("PUT THE TEXT OF THE CHECKLIST ITEM HERE"); | |
var trelloApiUrl = 'https://api.trello.com/1/checklists/' + trelloChecklistId + '/checkItems?key=' + trelloApiKey + '&token=' + trelloToken; | |
fetch(trelloApiUrl, {method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: checklistItemName}) | |
.then(function(res) { | |
return res.json(); | |
}) | |
.then(function(body) { | |
var output = {body: body}; | |
callback(null, output); | |
}) | |
.catch(callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! Could you explain in comments what you do from line 28 "fetch" part?
Also how would this do, when using Zapier Code Python?