Gowtham Rajamanickam

Gowtham Rajamanickam

  • 74
  • 25.8k
  • 7.5m

Retrive a Folder in Document Library using REST

Mar 23 2015 7:52 AM
//Retrieve all of the folders from root Site
function getFolders() {
var executor;
// Initialize the RequestExecutor with the app web URL.
executor = new SP.RequestExecutor(appweburl);
executor.executeAsync({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/getfolderbyserverrelativeurl('/GowthamLibrary')/folders?@target='" + hostweburl + "'",
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
}, success: FoldersSuccessHandler,
error: FoldersErrorHandler
});
}
 
im creating app to retrive the folders from Library but im getting error.i think uRL formation is wrong.anyone  can help me to fix this? 

Answers (1)