GroupDocs.Comparison Cloud allows to obtain list of revisions from Word document.
The following code sample demonstrates how to get list of all revisions.
API usage
There are steps that usage of GroupDocs.Comparison Cloud consists of:
Upload input documents into cloud storage
Call API method
Download comparison result document from storage (if any)
Steps 1 and 3 are storage operations, please refer to this File API documentation for usage details.
Swagger UI lets you call this REST API directly from the browser.
cURL example
// First get JSON Web Token
// Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"// cURL example to get document information
curl -v "https://api.groupdocs.cloud/v2.0/comparison/revisions"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer <jwt token>"-d "{
'FilePath': 'source_files/word/source_with_revs.docx'
}"
[{"id":0,"action":"None","text":"\rsssssssss","author":"GroupDpcs","type":"Insertion"},{"id":1,"action":"None","text":"Many students, scholars and members of the \u0013 HYPERLINK \"https://en.wikipedia.org/wiki/Minister_(Christianity)\" \\o \"Minister (Christianity)\" \u0014Christian clergy\u0015 speak Latin fluently, and it is taught in primary, secondary and post-secondary educational institutions around the world.\u0013 HYPERLINK \"https://en.wikipedia.org/wiki/Latin\" \\l \"cite_note-4\" \u0014[4]\u0015\u0013 HYPERLINK \"https://en.wikipedia.org/wiki/Latin\" \\l \"cite_note-5\" \u0014[5]\u0015\r","author":"GroupDocs","type":"Deletion"}]
SDK example
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Comparison Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.
// For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-dotnet-samplesstringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudstringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);varapiInstance=newReviewApi(configuration);varsourceFile=newFileInfo{FilePath="source_files/word/source_with_revs.docx"};varrequest=newGetRevisionsRequest(sourceFile);varrevisions=apiInstance.GetRevisions(request);Console.WriteLine("GetListOfRevisions: Revisions count: "+revisions.Count);
// For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-java-samples
StringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
StringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);ReviewApiapiInstance=newReviewApi(configuration);FileInfosourceFileInfo=newFileInfo();sourceFileInfo.setFilePath("source_files/word/source_with_revs.docx");GetRevisionsRequestrequest=newGetRevisionsRequest(sourceFileInfo);List<RevisionInfo>rInfos=apiInstance.getRevisions(request);System.out.println("Revisions count: "+rInfos.size());
// For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-php-samples
useGroupDocs\Comparison\Model;useGroupDocs\Comparison\Model\Requests;$ClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$ClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Comparison\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$apiInstance=newGroupDocs\Comparison\ReviewApi($configuration);$sourceFile=newModel\FileInfo();$sourceFile->setFilePath("source_files/word/source_with_revs.docx");$revisions=$apiInstance->getRevisions(newRequests\GetRevisionsRequest($sourceFile));echo"Revisions count: ",count($revisions);echo"\n";
// For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-node-samples
global.comparison_cloud=require("groupdocs-comparison-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.reviewApi=comparison_cloud.ReviewApi.fromKeys(clientId,clientSecret);try{letsource=newcomparison_cloud.FileInfo();source.filePath="source_files/word/source_with_revs.docx";letrequest=newcomparison_cloud.GetRevisionsRequest(source);letrevisions=awaitreviewApi.getRevisions(request);console.log("Revisions count: "+revisions.length);}catch(error){console.log(error.message);}
# For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-python-samplesimportgroupdocs_comparison_cloudclient_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudapi_instance=groupdocs_comparison_cloud.ReviewApi.from_keys(client_id,client_secret)source=groupdocs_comparison_cloud.FileInfo()source.file_path="source_files/word/source_with_revs.docx"revisions=api_instance.get_revisions(groupdocs_comparison_cloud.GetRevisionsRequest(source))print("Revisions count: "+str(len(revisions)))
# For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-ruby-samplesrequire'groupdocs_comparison_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudapi_instance=GroupDocsComparisonCloud::ReviewApi.from_keys($client_id,$client_secret)source=GroupDocsComparisonCloud::FileInfo.newsource.file_path="source_files/word/source_with_revs.docx"request=GroupDocsComparisonCloud::GetRevisionsRequest.new(source)revisions=apiInstance.get_revisions(request)puts("Revisions count: "+revisions.length.to_s)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.