This article explains how to use the GetChanges method from the ComparisonApi in the GroupDocs SDK.

Requirements

We already know how to install the Fatfree framework and prepare for creating the sample from a previous article. The sample that we create in this article is not much different from other Fatfree examples. We need a template file with a form and a controller file to process entered data.

LogicTo get a list of changes we need two documents to compare with the GroupDocs Comparison API. We’ll look at the output document that a comparison creates. Lets take a look at the logic that this sample implements:

  1. A user enter User ID, Private Key and File GUID (from GroupDocs account) into the form.
  2. The entered data is transfered to the controller for processing.
  3. Get entered data.
  4. Check entered data.
  5. Create GroupDocsRequestSigner, APIClient and ComparisonApi objects.
  6. Get all changes from document.
  7. Create a table with a list of changes.
  8. Return this table to the template.

You may think that this logic implies a lot of work, but that’s not so: with GroupDocs PHP SDK it’s very simple. And now, let me show you how.

ImplementationFirst of all let’s take a look at the complete controller code:```