Hi All,
I am not Not to rename the folder using REST API using POSTMAN, Please refer to the below screenshot of my REQUEST

Hi All,
I am not Not to rename the folder using REST API using POSTMAN, Please refer to the below screenshot of my REQUEST

Hi MadhuSudanSingh-1785,
You need to set the Content-Type header as application/json;odata=verbose, as the below:

And the body:
{
"__metadata": {
"type": "SP.Data.Shared_x0020_DocumentsItem"
},
"FileLeafRef": "NewFolderName"
}
If an Answer is helpful, please click "Accept Answer" and upvote it.
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.
The issue is that you're passing an ETag to the request. ETags (and other E-headers) are used to detect modifications. They are most often used for GET requests and allow a server (or proxy) to skip retrieval of the data if there has been no changes on the E-headers since the last request. It is a caching mechanism.
In your case you are passing an ETag probably from a previous GET. However by the time you make the request the object has been modified and therefore the tag doesn't match and it fails the call. This is a concurrency detection thing. Two solutions that I can see.
Option 1 update to the new ETag and try again. In your Postman screenshot it doesn't actually look like you're passing the ETag header so that might be the problem by itself. Set the header to whatever you got from the GET request and try again.
Option 2 is to not bother with the concurrency detection. Since you're just renaming a folder I would wager changes to it shouldn't matter. Therefore remove the If-Match header.
Hi,
Even after removing If-Match header, I get an error, below is the response

The body is as below
{
"__metadata": {
"type": "SP.Data.Shared_x0020_DocumentsItem"
},
"Title": "Newname",
"FileLeafRef": "Newname"
}
I don't use SP API so maybe the tag is required. Add the If-Match header in again and also ensure you are setting the ETag header to the value from the previous GET (or for testing the value it is giving you). As I mentioned earlier it didn't appear you were actually passing the ETag originally.
Also note that the Headers tab in Postman shows you passing a lot of headers. Be sure to scan those as well. It is possible the header(s) are being auto-added by the collection/folder and causing issues. If in that tab you see the ETag/If-Match headers then it is being applied by the collection/folder or session. This is common in sample PM collections. We tell you to run a GET and we use a post-run script to update your environment with values from the results so we can then tell you to run a POST/PUT and it uses the results of your previous GET.
Hi,
Thanks for your quick response.
I went through the API documentation which says give Etag or , so I mentioned and now I get a new error.

Request Body is as below
{
"__metadata": {
"type": "SP.Data.Shared_x0020_DocumentsItem"
},
"Title": "Newname",
"FileLeafRef": "Newname"
}
8 people are following this question.
Not abe to create a folder in Sharepoint Site
Custom DLL Deployment in SharePoint Online
How to get sharepoint site group name using Graph API?
Need Script to read list of SPO sites from excel and get owners and members list as in csv OutPut
Regarding the SharePoint Online List formatting (Document Library)