Update status field for a folder in sharepoint document library using restapi

NILANJAN MUKHERJEE 1 Reputation point
2021-04-07T11:46:57.897+00:00

I have sharepoint ducument library, inside this there are many folders. I want to update the status column of the folders on click of the button. Though I can do this using the folder id var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Documents1')/items(152) .
However I want to do this using the folder name .Please suggest what will be the endpoint url

Many Thanks,
Nil

Microsoft 365 and Office SharePoint Server Development
{count} votes

1 answer

Sort by: Most helpful
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2021-04-08T06:13:37.483+00:00

    Hi @NILANJAN MUKHERJEE ,

    Modify as below to use GetFolderByServerRelativeUrl with folder relative url:

    https://tenant.sharepoint.com/sites/dev/_api/web/GetFolderByServerRelativeUrl('/sites/dev/shared documents/folder1')/ListItemAllFields  
    

    85580-snipaste-2021-04-08-14-13-00.png

    Thanks
    Best Regards


    If the response 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.

    0 comments No comments

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.