GroupDocs team always works passionately to provide out of the box solutions for their users, in this regard we are proudly announcing first release of Next Generation GroupDocs.Comparison Cloud 17.12 REST API for public use. It is a platform independent document comparison REST API that can be integrated with any development language. Our Document Comparison Cloud API is providing two main resources for document comparison operation, Changes and Comparison Document which allows you to get an array of changes or get result document file path or stream. This API can be used in your applications for better user experience and enhanced performance. It supports all major business document and image formats, please click here for further details.

Features - GroupDocs.Comparison Cloud

GroupDocs.Comparison Cloud is a REST API for comparing almost all major documents and image formats, like Word, Cell, Html, PDF, PowerPoint and Image. Some major features are as follows. You may visit release notes for complete details.

Document Resources:

Changes Resource:

Get Changes from Compared Documents

You can quickly compare the document with other document of same formats. Here is the list of supported formats, please have a look on quick example of DOCX to DOCX comparison using GroupDocs.Comparison Cloud API.

URL

 https://apireference.groupdocs.cloud/comparison/#!/Changes/PostChanges

Request Body

{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

cURL Example

curl -v "https://api.groupdocs.cloud/v1.0/comparison/compareDocuments/changes?appsid=XXXX&signature=XXX-XX"
-H "content-type: application/json"
-X POST -d "{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

GoupDocs.Comparison Cloud API .NET SDK Example

 var configuration = new Configuration

{
    AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
// Initiate API object
var apiInstance = new ChangesApi(configuration);
try
{
    // Comparison Request
    ComparisonRequest comparisonRequest = new ComparisonRequest()
    {
        // Comparison Request Settings
        Settings = new ComparisonRequestSettings()
        {
            GenerateSummaryPage = true,
            ShowDeletedContent = true,
            StyleChangeDetection = true,
            UseFramesForDelInsElements = false,
            DetailLevel = "Low",
            DeletedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Red
            },
            InsertedItemsStyle = new StyleSettingsValues()
            {
               BeginSeparatorString = "",
                EndSeparatorString = "",
               Color = new Color().Blue
            },
            StyleChangedItemsStyle = new StyleSettingsValues()
            {
               BeginSeparatorString = "",
               EndSeparatorString = "",
                Color = new Color().Green
            },
            CalculateComponentCoordinates = false,
            CloneMetadata = "Source",
            MarkDeletedInsertedContentDeep = false,
            MetaData = new ComparisonMetadataValues()
          {
                Author = "GroupDocs",
                Company = "GroupDocs",
                LastSaveBy = "GroupDocs"
          },
            Password = "",
            PasswordSaveOption = ""

        },
        // Source file
        SourceFile = new ComparisonFileInfo()
        {
           Folder = "comparisons",
            Name = "source.docx",
            Password = ""
        }
    };

    List targets = new List();
    // Target file
    targets.Add(new ComparisonFileInfo()
    {
        Folder = "comparisons",
        Name = "target.docx",
        Password = ""
    });
    // Target file - single or multiple target files are allowed.
   comparisonRequest.TargetFiles = targets.ToArray();

    // Accept or Reject changes
    comparisonRequest.Changes = new List();
    comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" });
    comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" });

    // API call for response.

    var response = apiInstance.PostChanges(new Model.Requests.PostChangesRequest() { Request =    comparisonRequest });

    Console.WriteLine(string.Format("{0}: {1}", "response is List", response.Count.ToString()));
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ChangesApi.PostChanges: " + e.Message);
}

Get Document Resources

You can compare documents and can get the result document path by providing the JsonRequest Object data in the request body. The following GroupDocs.Comparison Cloud REST API example can be used to get result document path.

URL

 [`https://apireference.groupdocs.cloud/comparison/#!/Comparison/Comparison`](https://apireference.groupdocs.cloud/comparison/#!/Comparison/Comparison)

Request Body

{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

cURL Example

curl -v  "https://api.groupdocs.cloud/v1.0/comparison/compareDocuments?outPath=comparisons%2Fcomparedoutput.docx&appsid=XXXX&signature=XXX-XX" 
-H "Content-Type: application/json"
-X POST -d  "{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings
  ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

GoupDocs.Comparison Cloud API .NET SDK Example

 var configuration = new Configuration
{
    AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};

// Initiate API object
var apiInstance = new ComparisonApi(configuration);

try
{
    // Comparison Request
    ComparisonRequest comparisonRequest = new ComparisonRequest()
    {
        // Comparison Request Settings
        Settings = new ComparisonRequestSettings()
        {
            GenerateSummaryPage = true,
            ShowDeletedContent = true,
            StyleChangeDetection = true,
            UseFramesForDelInsElements = false,
            DetailLevel = "Low",
            DeletedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Red
            },
            InsertedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Blue
            },
            StyleChangedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Green
            },
            CalculateComponentCoordinates = false,
            CloneMetadata = "Source",
            MarkDeletedInsertedContentDeep = false,
            MetaData = new ComparisonMetadataValues()
            {
                Author = "GroupDocs",
                Company = "GroupDocs",
                LastSaveBy = "GroupDocs"
            },
            Password = "",
            PasswordSaveOption = ""
        },
        // Source file
        SourceFile = new ComparisonFileInfo()
        {
            Folder = "comparisons",
            Name = "source.docx",
            Password = ""
        }
    };

    List targets = new List();
    // Target file
    targets.Add(new ComparisonFileInfo()
    {
        Folder = "comparisons",
        Name = "target.docx",
        Password = ""
    });
    // Target file - single or multiple target files are allowed.
    comparisonRequest.TargetFiles = targets.ToArray();

    // API call for response.
    var response = apiInstance.Comparison(new Model.Requests.ComparisonRequest() { Request = comparisonRequest, OutPath = "comparisons/compare-result.docx" });

    Console.WriteLine(string.Format("{0}: {1}", "response is Link", response.Href.ToString()));
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ComparisonApi.Comparison: " + e.Message);
}

API Explorer

The GroupDocs Cloud provides an Web API explorer to try out our API right away in your browser. It is a collection of Swagger documentation for the GroupDocs Cloud APIs. Using Web API explorer, you can get information about all the resources in the API. It also provides testing and interactivity to our API endpoint documentation. Please click here for further details.

SDKsGroupDocs.Comparison

Cloud API is providing SDKs to use its features in your favorite platform such as .NET. The SDKs are hosted on our GitHub repository along with working examples, to get you started in no time.

GroupDocs.Comparison

Cloud API ResourcesYou may visit the following API resources for getting started and working with the API.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the GroupDocs Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by GroupDocs Cloud.