commit de6fd09921c04313aea3a9b75f458e3bff6d8532 Author: Aadil Ayub Date: Tue Sep 19 16:38:41 2023 +0500 write basic script that fetches tasks as JSON diff --git a/index.js b/index.js new file mode 100644 index 0000000..4cdbb43 --- /dev/null +++ b/index.js @@ -0,0 +1,26 @@ +const username = 'aadil'; +const password = '9dc04fffe0c1c915be487f26a7f8d90f52d47b9861036e6093e8d932c162'; + +const authHeader = 'Basic ' + btoa(username + ':' + password); + +fetch('https://kanboard.autonomic.zone/jsonrpc.php', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Authorization': authHeader + }, + body: JSON.stringify({ + jsonrpc: '2.0', + method: 'getMyDashboard', + id: 1 + }), +}) + .then((response) => response.json()) + .then((data) => { + // Handle the response data + console.log(data); + }) + .catch((error) => { + // Handle any errors + console.error(error); + });