0

I want to create a folder inside "Communications" document library in below site using rest api.

https://contoso.sharepoint.com/sites/SP

Can you please assist on how to do that?

1

You need to use the Folders endpoint something like below:

_spPageContextInfo.siteAbsoluteUrl + "/_api/Web/Folders/add('Communications/NewFolderName')"

Note: You need to pass the ServerRelativeUrl inside the add method.

Official documentation: Working with folders by using REST.

Similar question: Creating Folder using REST and JavaScript

  • Thanks @Ganesh i am able to create a folder but now i want to create a new folder inside a pre-existing folder of a list. How i can achieve that? – Adarsh Awasthi Dec 3 at 11:20
  • You need pass the ServerRelativeUrl of the existing folder in add. – Ganesh Sanap Dec 3 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.