# POST /v1/processing/review/trackedchanges

> List the tracked changes of a Base64 RTF, DOC, DOCX or TX document as TrackedChange objects: kind, time stamp, author, text, position, highlight mode and id.

- **Product:** ReportingCloud
- **Section:** Documentation
- **Kind:** Endpoint
- **Path:** ReportingCloud > API Reference > Web API > Processing > /review/trackedchanges > POST /v1/processing/review/trackedchanges
- **2724 words**
- **Web URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/review-trackedchanges/post/
- **LLMs URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/review-trackedchanges/post/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/review-trackedchanges/post/llms-full.txt

---

`POST` `https://api.reporting.cloud/v1/processing/review/trackedchanges`

### Description

Lists the tracked changes of a document: every insertion and deletion, with its id, text, position, author and time. The request body is the document as a Base64 string, in DOCX, DOC, RTF or TX; a document in another format returns an empty array. Pass an id to [POST /v1/processing/review/removetrackedchange](https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/review-removetrackedchange/post/llms-full.txt) to accept or reject that change. This method doesn't count against a quota. See [Tracked Changes](https://docs.textcontrol.com/reporting-cloud/document-processing/tracked-changes/llms-full.txt).

### Examples

#### HTTP

Request:

```bash
curl -u username:password \
  -H "Content-Type: application/json" \
  --data "\"CAcBAA4AAAAAAAAAAAAAAAIAAABsAQAAAQ...==\"" \
  -X POST "https://api.reporting.cloud/v1/processing/review/trackedchanges"
```

Results:

```json
[{"changeKind":4096,"changeTime":"2019-01-01T00:00:00Z","defaultHighlightColor":"60, 255, 0, 0","highlightColor":"60, 87, 174, 168","highlightMode":3,"length":13,"start":3,"id":0,"text":"trackedchange","userName":"ReportingCloudUser"},
{"changeKind":4096,"changeTime":"2019-01-01T00:00:00Z","defaultHighlightColor":"60, 255, 0, 0","highlightColor":"60, 137, 19, 118","highlightMode":3,"length":13,"start":21,"id":1,"text":"trackedchange","userName":"ReportingCloudUser2"}]
```

#### C#

Request:

```csharp
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using TXTextControl.ReportingCloud;

class RCSamples
{
    public static void GetTrackedChanges(string documentName)
    {
        ReportingCloud rc = new ReportingCloud(
            "username",
            "password",
            new Uri("https://api.reporting.cloud"));

        try
        {
            byte[] bDocument = File.ReadAllBytes(documentName);
            List<TrackedChange> trackedChanges = rc.Processing.Review.GetTrackedChanges(bDocument);

            foreach (TrackedChange trackedChange in trackedChanges)
            {
                Console.WriteLine("Change " + trackedChange.Id + " by " + trackedChange.UserName
                    + ": " + trackedChange.Text + " (" + trackedChange.ChangeKind + ")");
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("An error occurred: " + e.Message);
        }
    }
}
```

Results:

```text
Change 0 by ReportingCloudUser: trackedchange (InsertedText)
Change 1 by ReportingCloudUser2: trackedchange (InsertedText)
```

#### Java

```java
// Example code coming soon.
```

#### Ruby

```ruby
# Example code coming soon.
```

#### PHP

Request:

```php
<?php

require_once __DIR__ . '/vendor/autoload.php';

use TextControl\ReportingCloud\ReportingCloud;

$reportingCloud = new ReportingCloud([
    'api_key' => (string) getenv('REPORTINGCLOUD_API_KEY'),
]);

$sourceFilename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tracked_changes.docx';

foreach ($reportingCloud->getTrackedChanges($sourceFilename) as $trackedChange) {
    var_dump("Change {$trackedChange['id']} by {$trackedChange['username']}: {$trackedChange['text']}");
}
```

Results:

```text
string(45) "Change 0 by ReportingCloudUser: trackedchange"
string(46) "Change 1 by ReportingCloudUser2: trackedchange"
```

### Authorization

This endpoint requires a "ReportingCloud-APIKey" or a "Basic" user authorization to access the user account, data and templates. Only one of these two methods is required.

[API Keys](https://docs.textcontrol.com/reporting-cloud/installation/api-keys/llms-full.txt) describes how to create an API key, and [Authentication](https://docs.textcontrol.com/reporting-cloud/document-processing/authentication/llms-full.txt) explains both header forms.

#### ReportingCloud-APIKey

| Header field | Description |
|---|---|
| Authorization | **Required**. A valid ReportingCloud account is required. The Authorization field is constructed as follows: An API key needs to be generated in the portal or with [PUT /v1/account/apikey](https://docs.textcontrol.com/reporting-cloud/reference/web-api/account/apikey/put/llms-full.txt). The authorization method and a space, "ReportingCloud-APIKey ", is then put before the actual API key string. For example: `Authorization: ReportingCloud-APIKey oMDM4MrAqL9QEOpyzupnQW5NjvCNtvE5cVDaaLqxI` |

#### Basic

| Header field | Description |
|---|---|
| Authorization | **Required**. A valid ReportingCloud account is required. The Authorization field is constructed as follows: The user name and password are combined into a string separated by a colon, for example `username:password`. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space, "Basic ", is then put before the encoded string. For example: `Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l` |

### Request Payload

| Type | Value |
|---|---|
| Base64 encoded string | The source document encoded as a Base64 string. Possible document formats are .rtf, .doc, .docx and .tx. A document in another format, like one without tracked changes, returns an empty array. |

### Success Response

| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of [TrackedChange](#success-response) objects. |

#### TrackedChange

| Name | Type | Value | Optional |
|---|---|---|---|
| changeKind | ChangeKind | Gets the kind of the tracked change. Possible values: 4096 (InsertedText), 8192 (DeletedText). Format changes are not returned, and moved text is returned as a deletion and an insertion. | no |
| changeTime | DateTime | Gets the time stamp of the tracked change, in UTC: `2019-01-01T00:00:00Z`, with up to seven decimals of a second where the document stores them: `2019-08-06T12:34:13.9188379Z`. | no |
| defaultHighlightColor | String | Gets the default highlight color of tracked changes, as four comma-separated numbers: `60, 255, 0, 0`. | no |
| highlightColor | String | Gets the highlight color of the tracked change, in the form of `defaultHighlightColor`. | no |
| highlightMode | HighlightMode | Gets the highlight mode of the tracked change. Possible values: 1 (Never), 2 (Activated), 3 (Always). | no |
| length | Integer | Gets the length of the change. | no |
| start | Integer | Gets the one-based index of the first character of the change, counted in the part of the document that holds it: the main text, a header or a footer. A paragraph end counts as one character. | no |
| id | Integer | Gets the unique id of the tracked change that can be used to remove the tracked change. The ids of a document start at 0, in the order of the array. After a change is removed, the ids of the changes that follow it decrease by 1. | no |
| text | String | Gets the text of the tracked change. | no |
| userName | String | Gets the user name of the author for that tracked change. Empty, if the document names no author. | no |

### Error Response

| Status | Description |
|---|---|
| 400 | A 400 (Bad Request) with the plain text "No merge data found in body" is returned, if the request body is empty or is not a JSON string. |
| 403 | A 403 (Forbidden) is returned, if the user is not authorized. |
| 405 | A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than POST. The Allow header of the response names POST. |
| 411 | A 411 (Length Required) is returned, if the request has neither a body nor a Content-Length header. |
| 415 | A 415 (Unsupported Media Type) is returned, if the request has a body but no Content-Type header, or a Content-Type such as text/plain that the endpoint doesn't read. Send Content-Type: application/json. |
| 500 | A 500 (Internal Server Error) is returned, if the request has no Authorization header, an empty one or one that is not the authorization method, a space and the credentials, or if the request body is a JSON string that is not valid Base64. |

---

## Nearby

- **Previous:** [/v1/processing/review/trackedchanges](https://docs.textcontrol.com/reporting-cloud/reference/web-api/processing/review-trackedchanges/llms-full.txt)
