Get the content of pervious file version

Brass Contributor

Hi All,

 

I'm trying to get the content of the last Major version of a document (so it can be published to another site as a PDF).  So if the document is at version 3.6, I need the content of 3.0 to publish.

 

I'm able to work out the current Major version by looking at the actual version and splitting on the decimal.  If the decimal portion is 0, the current file is published.

 

I then use a "Send HTTP request to SharePoint" with _api/web/getfilebyserverrelativeurl('/sites/SrcSite/@{items('Apply_to_each')?['{FullPath}']}')/versions as the URI

 

The results are then filtered to get the version I'm after.  I've seen posts else where that use the resulting _vti_history/17/SrcSite/File name.docx Uri within a "Get file content using path", however that just returns a 404 error.

 

Any ideas on if/how this might be doable?

 

0 Replies