Action
Add to Dynalist Inbox
Adds draft to Dynalist Inbox, using the draft’s title as the item and the draft’s body as the note.
Steps
-
script
// Before running this script for the first time: // Copy your Dynalist token from https://dynalist.io/developer and enter it when prompted // You can remove the token later via Drafts Preferences > Credentials var credential = Credential.create("Secret Token of Dynalist", "Dynalist"); credential.addPasswordField("token", "Secret Token"); credential.authorize(); var http = HTTP.create(); var response = http.request({ "url": "https://dynalist.io/api/v1/inbox/add", "encoding": "json", "method": "POST", "data": { "token": credential.getValue("token"), "index": "-1", "content": draft.processTemplate('[[title]]'), "note": draft.processTemplate('[[body]]') } }); if (response.success) { var rText = JSON.parse(response.responseText); if (rText._code == 'Ok') { app.displaySuccessMessage(rText._code); } else { alert(rText._code + '\n' + rText._msg); context.fail(rText._msg); } } else { console.log(response.statusCode); console.log(response.error); alert(response.statusCode + '\n' + response.error); context.fail(response.error); }
Options
-
After Success Default Notification Error Log Level Error
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.