Creating an account is very simple. Go to Dashboard to create a free account. We’re using Single Sign On across our websites, therefore, if you already have an account with our services, you can use it to also acccess the Dashboard.
Create an API client app
Before you can make any requests to GroupDocs Cloud API you need to get a Client Id and a Client Secret.
This will will be used to invoke GroupDocs Cloud API. You can get it by creating a new Application.
Install the SDK of your choice
GroupDocs Cloud SDK is written in different languages, all you need to get started is adding our SDK to your existing project.
Make an API request from the SDK of your choice
Use the Client Id and the Client Secret from the API app client you created in step one and replace in the corresponding code. Below is an example demonstrating how to compare two docx documents using GroupDocs.Comparison Cloud.
Note
The GitHub repository for GroupDocs.Comparison Cloud has a complete set of examples, demonstrating our API capabilities.
// 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=newCompareApi(configuration);varoptions=newComparisonOptions{SourceFile=newFileInfo{FilePath="source_files/word/source.docx"},TargetFiles=newList<FileInfo>{newFileInfo{FilePath="target_files/word/target.docx"}},OutputPath="output/result.docx"};varrequest=newComparisonsRequest(options);varresponse=apiInstance.Comparisons(request);
// 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);CompareApiapiInstance=newCompareApi(configuration);FileInfosourceFileInfo=newFileInfo();sourceFileInfo.setFilePath("source_files/word/source.docx");FileInfotargetFileInfo=newFileInfo();targetFileInfo.setFilePath("target_files/word/target.docx");ComparisonOptionsoptions=newComparisonOptions();options.setSourceFile(sourceFileInfo);options.addTargetFilesItem(targetFileInfo);options.setOutputPath("output/result.docx");ComparisonsRequestrequest=newComparisonsRequest(options);Linkresponse=apiInstance.comparisons(request);
// 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\CompareApi($configuration);$sourceFile=newModel\FileInfo();$sourceFile->setFilePath("source_files/word/source.docx");$targetFile=newModel\FileInfo();$targetFile->setFilePath("target_files/word/target.docx");$options=newModel\ComparisonOptions();$options->setSourceFile($sourceFile);$options->setTargetFiles([$targetFile]);$options->setOutputPath("output/result.docx");$request=newRequests\ComparisonsRequest($options);$response=$apiInstance->comparisons($request);
// 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.compareApi=comparison_cloud.CompareApi.fromKeys(clientId,clientSecret);try{letsource=newcomparison_cloud.FileInfo();source.filePath="source_files/word/source.docx";lettarget=newcomparison_cloud.FileInfo();target.filePath="target_files/word/target.docx";letoptions=newcomparison_cloud.ComparisonOptions();options.sourceFile=source;options.targetFiles=[target];options.outputPath="output/result.docx";letrequest=newcomparison_cloud.ComparisonsRequest(options);letresponse=awaitcompareApi.comparisons(request);console.log("Output file link: "+response.href);}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.CompareApi.from_keys(client_id,client_secret)source=groupdocs_comparison_cloud.FileInfo()source.file_path="source_files/word/source.docx"target=groupdocs_comparison_cloud.FileInfo()target.file_path="target_files/word/target.docx"options=groupdocs_comparison_cloud.ComparisonOptions()options.source_file=sourceoptions.target_files=[target]options.output_path="output/result.docx"request=groupdocs_comparison_cloud.ComparisonsRequest(options)response=api_instance.comparisons(request)
# 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::CompareApi.from_keys($client_id,$client_secret)source=GroupDocsComparisonCloud::FileInfo.newsource.file_path="source_files/word/source.docx"target=GroupDocsComparisonCloud::FileInfo.newtarget.file_path="target_files/word/target.docx"options=GroupDocsComparisonCloud::ComparisonOptions.newoptions.source_file=sourceoptions.target_files=[target]options.output_path="output/result.docx"request=GroupDocsComparisonCloud::ComparisonsRequest.new(options)response=apiInstance.comparisons(request)
// Create configuration and API instances
Configurationconfig=newConfiguration('YOUR_API_KEY','YOUR_API_SECRET');// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
FileApifileApi=newFileApi(config);CompareApicompareApi=newCompareApi(config);// Upload source Word file to cloud storage
List<ContentVersion>sourceVersions=[SELECTId,Title,VersionDataFROMContentVersionWHERETitle='source.docx'LIMIT1];if(sourceVersions.size()>0){fileApi.uploadFile(newUploadFileRequest('source_files/word/source.docx',sourceVersions[0].VersionData,null));}// Upload target Word file to cloud storage
List<ContentVersion>targetVersions=[SELECTId,Title,VersionDataFROMContentVersionWHERETitle='target.docx'LIMIT1];if(targetVersions.size()>0){fileApi.uploadFile(newUploadFileRequest('target_files/word/target.docx',targetVersions[0].VersionData,null));}// Set up comparison options
ComparisonOptionsoptions=newComparisonOptions();options.SourceFile=newFileInfo();options.SourceFile.FilePath='source_files/word/source.docx';options.TargetFiles=newList<FileInfo>();FileInfotargetFile=newFileInfo();targetFile.FilePath='target_files/word/target.docx';options.TargetFiles.add(targetFile);options.OutputPath='output/result.docx';// Execute comparison
ComparisonsRequestrequest=newComparisonsRequest(options);Linkresponse=compareApi.comparisons(request);// Debug the result
System.debug('Comparison complete. Output file link: '+response.href);
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.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.