How to create Folder and a Subfolder using Postman

Nani 26 Reputation points
2021-11-12T14:48:13.64+00:00

Hi Experts,

I was trying to create a Folder and a Subfolder in a single call using Postman.

If I give Folder name/Subfolder name, It is throwing 500 error.

If I give only Folder name, it is creating a folder and I have to do another call to create a Subfolder inside the created folder.

Is there any possibility to create a Folder and a Subfolder in a single call?
Postman:
148932-image.png
148877-image.png

Microsoft 365 and Office SharePoint Development
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2021-11-15T05:29:36.293+00:00

    Hi @Nani ,
    Per my test and research, SharePoint REST API will not create parent folder and child folder at the same time. The rest api can only work with the right path. It's unable to auto create folder if the Folder doesn't exist. It will throw an error not found. So if we need to create a subfolder. We should take two steps: create parent folder first and then create the subfolder.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nani 26 Reputation points
    2021-11-16T12:53:19.647+00:00

    Hi @RaytheonXie_MSFT ,

    Thank you for your time.

    I achieved this requirement using Groovy Script. It is working fine for me now.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.