I have created an document set with a temporary name but now want to rename it using REST API.
I do not want to create a new document set and move the files to the new location.
Is there any way to accomplish my requirement?
I have created an document set with a temporary name but now want to rename it using REST API.
I do not want to create a new document set and move the files to the new location.
Is there any way to accomplish my requirement?
Yes, a Document Set is basically a folder. Here's an example for "Shared Documents" and a folder or doc set named "Toys".
URL:
https://yourServer/sites/training/demoworkflow/_api/web/GetFolderByServerRelativeUrl('Shared Documents/Toys')/ListItemAllFields
Method:
POST
Headers:
{ "accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE",
"If-Match": "*",
"content-length":___yourBodyLen___,
"X-RequestDigest": "___yourRequestDigest___"}
Body:
{"__metadata":{"type":"SP.Data.Shared_x0020_DocumentsItem"},
"Title":"TestToysDocs", "FileLeafRef":"TestToysDocs" }
Replace the ___text___
with your data.