console.clear();
function get(uri,title) {
if (typeof uri === 'object') uri = uri.__deferred.uri;
fetch(uri, {
method: 'GET',
credentials: 'same-origin', // or credentials: 'include'
headers: new Headers({
"Accept": "application/json; odata=verbose",
})
}).then((response) => response.json())
.then((data) => {
console.info(title,data.d);
(data.d.results || [data.d]).forEach((item) => {
switch (item.__metadata.type) {
case 'SP.Web':
get(item.Lists,'Lists in Web: '+item.Title);
break;
case 'SP.List':
if(item.Title==='Tasks'){
get(item.Items,'Items in List: '+item.Title);
}
break;
default:
console.log('unknown type', item.__metadata.type);
}
});
});
}
get('/sites/[YOURSITENAME]/_api/Web','Root');
Danny '365CSI' Engelman
- 21.2k
- 7
- 36
- 79
Danny '365CSI' Engelman
- 21.2k
- 7
- 36
- 79
Danny '365CSI' Engelman
- 21.2k
- 7
- 36
- 79
Danny '365CSI' Engelman
- 21.2k
- 7
- 36
- 79
Danny '365CSI' Engelman
- 21.2k
- 7
- 36
- 79