I am trying to retrieve comments from my previous check in's in a library file in SharePoint Online.
In SharePoint Online I can see the Check in comments successfully present in all the file versions but by using REST API I can only see the last check in comment getting duplicated in every version.
For example, in SharePoint there are these versions details:
You can see that version 5.0 has "WENARDO 2" as a check in comment value and the last version (7.0) has "test".
But by the following REST query,
[siteurl]/_api/web/lists/getbytitle('[library]')/items([id])/versions?$expand=Fields,Attachments
I am getting these values:
var results = response.map(function(item) {return item.OData__x005f_CheckinComment});
console.log(results);
["test", "test", "test", "test", "test", "test", "test", "test"]
As you can see, I am getting the last Check in Comment for every version.
In fact, in the JSON response, there is no match for the text "WENARDO" or "WENARDO 2".
How can I get those values using REST?
Thanks in advance.