Hi Chorst,
As far as I know, there's no public API to read version history in 31.8.4. The only versioning type in CMS.ContentEngine is ContentItemVersionActionContext, and that's for disabling version storing, not reading versions. The history is stored in the database, but that storage isn't documented, so I wouldn't rely on it because it could change in any Refresh.
What works well is recording the history yourself with content events, available since 31.3:
public class PagePublishHistoryHandler : IAsyncEventHandler<AfterPublishWebPageEvent>
{
public Task HandleAsync(AfterPublishWebPageEvent asyncEvent, CancellationToken cancellationToken)
{
var data = asyncEvent.Data;
// store data.ContentTypeName, data.TreePath, data.WebsiteChannelName, timestamp...
return Task.CompletedTask;
}
}
Register it in a module's OnPreInit:
parameters.Services.AddEventHandler<AfterPublishWebPageEvent, PagePublishHistoryHandler>();
For Content hub items use AfterPublishContentItemEvent, and for headless items AfterPublishHeadlessItemEvent.
I tested this on Dancing Goat (31.8.4), and it fired for both pages and Content hub items. The built-in history also only records published versions (saves don't create entries), so this approach gives you at least the same data. Just keep in mind that it only captures publishes from the moment you add it.
Docs: Handle content events