I am using a REST API to get the list of all files inside a document library.
However, this also brings the list of all folders.
Is there a way to filter out the folders and bring only the files using the REST API?
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl+"/_api/web/lists/getbytitle('Document Library Name')/items?$top=1000&$select=Title,FieldValuesAsText/FileRef,FieldValuesAsText/FileRef/Title&$expand=FieldValuesAsText",
headers: { "Accept": "application/json; odata=verbose" },
cache: false,
success: function (data) {
//some code
},
error: function (xhr) {
console.log(xhr);
}
});