SharePoint REST API Setting CheckoutUser using ValidateUpdateListItem()

154 views Asked by At

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.

0

There are 0 answers