ReportingCloud

POST /v1/processing/review/trackedchanges

Endpoint

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 to accept or reject that change. This method doesn't count against a quota. See Tracked Changes.

Examples

Request:

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

Results:

[{"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"}]

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 describes how to create an API key, and Authentication explains both header forms.

ReportingCloud-APIKey

Header fieldDescription
AuthorizationRequired. 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. 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 fieldDescription
AuthorizationRequired. 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

TypeValue
Base64 encoded stringThe 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

StatusDescription
200On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of TrackedChange objects.

TrackedChange

NameTypeValueOptional
changeKindChangeKindGets 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
changeTimeDateTimeGets 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
defaultHighlightColorStringGets the default highlight color of tracked changes, as four comma-separated numbers: 60, 255, 0, 0.no
highlightColorStringGets the highlight color of the tracked change, in the form of defaultHighlightColor.no
highlightModeHighlightModeGets the highlight mode of the tracked change. Possible values: 1 (Never), 2 (Activated), 3 (Always).no
lengthIntegerGets the length of the change.no
startIntegerGets 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
idIntegerGets 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
textStringGets the text of the tracked change.no
userNameStringGets the user name of the author for that tracked change. Empty, if the document names no author.no

Error Response

StatusDescription
400A 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.
403A 403 (Forbidden) is returned, if the user is not authorized.
405A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than POST. The Allow header of the response names POST.
411A 411 (Length Required) is returned, if the request has neither a body nor a Content-Length header.
415A 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.
500A 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.