question

Tony-7954 avatar image
0 Votes"
Tony-7954 asked Tony-7954 commented

SharePoint REST API Setting CheckoutUser using ValidateUpdateListItem()

I am trying to update the CheckoutUser for a file in SharePoint because when the file is checked out in my code, it is being checked out by a SharePoint admin account and I want the CheckoutUser to show the person who actually checked it out. Whenever I make a request to _api/web/GetList(@path)/items(id)/ValidateUpdateListItem()?@path='/url' with the user info, I get a 200 response back and no errors, but for some reason the CheckoutUser value is cleared instead up updating to be the user that I want to set. This is what the request body looks like:

 {
     "formValues": [
         {
             "FieldName": "CheckoutUser",
             "FieldValue": "[{'Key': 'i:0#.w|user.name'}]"
         }
     ],
     "bNewDocumentUpdate": true
 }


I have tested out requests to both SharePoint 2016 and SharePoint Online using Postman and have not been able to get the CheckoutUser to update in either case.

office-sharepoint-onlinesharepoint-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TongZhangMSFT-7548 avatar image
1 Vote"
TongZhangMSFT-7548 answered Tony-7954 commented

Hi @Tony-7954,

Thanks for the detailed description of the case. When I received the case, I searched a lot of documents did a lot of researches.

I use the REST API _api/web/lists('list-id')/items(id)/ValidateUpdateListItem() to do test ,but I get the error: The file \"https://xxxxx.sharepoint.com/sites/xxxx/test1/Document1.docx\" is checked out for editing by i:0#.f|membership|xxx@xxxxx. (the screenshot of my test results is as follows) .

We will continue to research this issue ,If there is an update or progress, will tell you in time. Thank you for your understanding and support.

198399-image.png


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.





image.png (72.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Tony-7954

I am checking to see if the problem has been resolved. If you have any questions or progress, you can contact me in time.

0 Votes 0 ·
Tony-7954 avatar image Tony-7954 TongZhangMSFT-7548 ·

Hi @TongZhangMSFT-7548, haven't been able to make any progress on this so let me know if this gets resolved.

0 Votes 0 ·