I need to update the version number of a document in a document library in SharePoint Online. I used postman to test this. Here is the POST Request I used.
https://MySharePointServer/sites/MySite/_api/web/getfilebyserverrelativeurl('/sites/MySite/JobApplications/Application001.docx')/ListItemAllFields
Request Headers
Accept : application/json;odata=verbose
Authorization : 'My Authorization Code Here'
X-HTTP-Method : MERGE
If-Match : *
Content-Type : application/json;odata=verbose
X-RequestDigest : 'MyRequestDigestCodeHere'
Request Body
{ '__metadata': { 'type': 'SP.Data.JobApplicationsItem' }, 'OData__UIVersionString': '4.0' }
But when I send this request I always get the following response.
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": {
"lang": "en-US",
"value": "Access denied. You do not have permission to perform this action or access this resource."
}
}
}
Do you have any idea what I'm doing wrong here? Any suggestions would be highly appreciated.
_api/contextinfo?