Creating Folder in Sharepoint Site from Postman

Srikanth 21 Reputation points
2022-04-07T21:39:37.647+00:00

Hi All,

We're trying to create a folder in the SharePoint from third party system with the help of the below link, prior to that we are trying it from Postman, but the call takes about a minute with out any response.

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

Step 1: Get the access token (Bearer token)
Step 2: Using the Step 1 token get the X-RequestDigest value.

191110-picture-1.png

Step 3: Using the Step 1 token and Step 2 "FormDigestValue" preparing the next call to Create a folder in SharePoint.
a. Header Info
191232-picture-2.png
b. Body
191241-picture-3.png
Step 3 Call response: "Could not get response".

Is there any issue in the call? Can you please give us any direction to resolve this issue.
Appreciate your help. Thanks you

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,761 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
320 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tong Zhang_MSFT 9,136 Reputation points
    2022-04-08T03:36:26.297+00:00

    Hi @Srikanth ,
    According to my research and testing, you can try to create Folder in SharePoint site using postman according to the following steps.
    Hope it can help you, thanks for your understanding and support.

    Steps:
    1.get "Access_token";
    2.

    POST https://xxxx.sharepoint.com/sites/xxxxx/\_api/web/folders
    Authorization: "Bearer " + accessToken
    Accept: "application/json;odata=verbose"
    Content-Type: "application/json;odata=verbose"

    191080-image.png

    3.Input the following script in the body:

    {
    "__metadata": {
    "type": "SP.Folder"
    },
    "ServerRelativeUrl": "https://xxxx.sharepoint.com/sites/xxxxx/test/folder"
    }

    191147-image.png

    4.Click "Send", and the folder is created successfully.
    191146-image.png


    Update-------------------------------
    Please follow these steps to create a folder in SharePoint, and check if there are any missing steps:
    1.Follow the steps in the documentation to get the "Access_token" (as shown in the following screenshot).
    194199-image.png

    2.Copy the "Access_token" to "Authorization". And input "URL" , "Headers" and "Body"

    POST https://xxxx.sharepoint.com/sites/xxxxx/\_api/web/folders
    Authorization: "Bearer " + accessToken
    Accept: "application/json;odata=verbose"
    Content-Type: "application/json;odata=verbose"
    Content-Length: "148"

    {  
      "__metadata": {  
        "type": "SP.Folder"  
      },  
      "ServerRelativeUrl": "https://xxxxx.sharepoint.com/sites/xxxx/test/newfolder1"  
    }  
    

    194237-image.png
    194239-image.png

    My test results:
    194170-image.png

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    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.


    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ibrar Ahmad 1 Reputation point
    2022-08-24T09:20:27.537+00:00

    Hi @Tong Zhang_MSFT ,
    I am facing issue in contextinfo, Can you help me?

    234378-image.png

    234491-contextinfo1.png

    Thank You

    0 comments No comments