Hello everyone.
(Not sure if this belongs here or in the Developer category. Feel free to move around. Thanks!)
To scratch my own itch I built a simple API client module for Node.JS. Today I released it as dynalist-js on GitHub.
As usual it can be installed with npm install dynalist-js
. A simple example:
const Client = require('dynalist-js');
const dyn = new Client('<my developer api token>');
dyn.editDocument('<my file id>', [{
action: 'insert',
parent_id: 'root',
checkbox: true,
content: 'Get more coffee'
}]).then(function(response) {
console.log(response._success ? 'Done!' : 'Something went wrong');
});
It provides simple methods for almost all API endpoints (query and modify your file list, query and modify document contents, send to inbox, etc), plus a few utility methods for working with nodes or generating URLs. The README is currently the only documentation. Iām hoping to expand that and also provide some example scripts as a starting point.
(Please note that I wrote this purely for server-side Node.JS usage. I frankly have no idea if it would work when executed in a browser environment.)
Personally I currently use the client to periodically generate a āproject reportā that pulls data from my work document and presents it as a list of currently relevant information. I also generate a āworld reportā where I pull information from other APIs and write information to a Dynalist document as a sort of dashboard.
(Aside: Iām running these updates as GitHub Actions every few hours, so this is basically āserverlessā.)
I hope this interests some of you and Iām looking forward to your feedback.
Take care,
_Lasar