Yes, it is possible to get it. You can use REST calls to get the required information. The following code shall help you:
I have created respective arraylists to store the subsite, document library and folder information. Once the information is collected in the arraylists we can display it as per out requirement.
Get subsites:
$.ajax({
url: siteUrl + "/_api/web/webs/?$select=title,ServerRelativeUrl,Created,effectivebasepermissions&$filter=(effectivebasepermissions/high%20gt%2032)&$orderby=Created desc",
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
},
success: function(data) {
var tempArray = data.d.results;
$.each(data.d.results, function(index, item) {
var tempArray = new Array(2);
tempArray[0] = item.Title;
tempArray[1] = item.ServerRelativeUrl;
SubsiteDetails.push(tempArray);
});
},
error: function(data) {
//alert(JSON.stringify(data));
}
Get Document Libraries in subsites:
$.ajax({
url: siteUrl + "/_api/web/lists?filter=BaseTemplate eq '101'&$expand=RootFolder",
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
},
success: function(data) {
var lists = data.d.results;
$.each(lists, function(i, list) {
if (list.BaseTemplate == "101") {
var listUrl = list.RootFolder.ServerRelativeUrl;
var tempArray = new Array(2);
tempArray[0] = list.Title;
tempArray[1] = siteUrl + listUrl;
docLibList.push(tempArray);
}
});
},
error: function(data) {
//alert(JSON.stringify(error));
}
Get folders in document libraries:
var url = siteUrl + "/_api/web/lists/getbytitle('" + documentLibrary + "')/rootFolder/Folders?$expand=ListItemAllFields";
$.getJSON(url, function(data) {
//print folders
$(data.value).each(function(i, folder) {
if(folder.Name != "")
{
if (folder.Name != "Forms" && folder.Name != "Attachments" && folder.Name != "Item") {
var tempArray = new Array();
tempArray = [];
tempArray[0] = folder.Name;
tempArray[1] = siteUrl + folder.ServerRelativeUrl;
tempArray[2] = folder.ServerRelativeUrl;
if(tempArray != []){
folderDetails.push(tempArray);
}
}
}
});
Here the SharePoint system folders have been skipped.