Hi,
I'm trying to make a web app that should interface with canvas data via the API. I know that eventually I need to get it working with the OAuth system, but for development I wanted to get it working with an access token. My code looks like the below (essentially copied from another thread here), but it gives a failed to fetch error.
In another tab on the browser, I am logged into canvas.
Any help would be much appreciated. Thanks.
const apiToken = ;
const options = {
'method': 'GET',
'headers': {
'authorization': 'Bearer ' + apiToken,
'content-type': 'application/json',
'accept': 'application/json'
},
'timeout': 5000
};
let outputfromcanvas;
.then(res=>{outputfromcanvas = res; console.log(res)})
.catch(err=>console.log("err: ", err))