write basic script that fetches tasks as JSON
This commit is contained in:
commit
de6fd09921
26
index.js
Normal file
26
index.js
Normal file
@ -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);
|
||||
});
|
Loading…
Reference in New Issue
Block a user