You are here

You are here

Accessing Document Revisions

The API provides a way to work with previous versions of a document via the GetDocumentRevisions method.  It will return an array of SCMDocument objects ordered from the recent previous version to the oldest previous version.  Previous version document Id's can then be retrieved and used in other API calls.

Vertical Tabs

c#
string documentId = "<Document Id retrieved by other method calls>";
var revisions = springCMService.GetDocumentRevisions(token, new Guid(documentId));
foreach (var revision in revisions)
{
	Console.WriteLine("Version: {0}, Document Id: {1}",revision.Version,revision.Id);
}
java
String documentId = "<Document Id retrieved by other method calls>";
SCMDocument[] revisions = springCMService.getDocumentRevisions(token, documentId);
for(SCMDocument revision : revisions)
{
	System.out.format("Version: %s, Document Id: %s\n",revision.getVersion(),revision.getId());
}