const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
materials: [
{
name: 'Chapter 1',
filename: 'document.pdf',
contentType: 'application/pdf',
folderId: '<string>'
}
]
})
};
fetch('https://studyfetchapi.com/api/v1/materials/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));