Have two requests to the same SharePoint list:
fetch(`https://mysite.sharepoint.com/_api/web/lists/GetByTitle('list')/items(` + id + `)`,
{method: "GET",
headers: { "Accept": "application/json; odata=verbose" }}
)
.then(response => {
let test = response;
})
$.ajax({
url: "https://mysite.sharepoint.com/_api/web/lists/getbytitle('list')/items(" + id + ")",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
let test = data;
}
});
First one returns Failed to load resource: the server responded with a status of 403 (Forbidden)
Second one works fine.
Any ideas?