Skip to main content

Document Compare API Frontend Integration

Starting from v7.3 FP4 hotfix5, Filez Document Platform supports frontend integration for document compare API.

Description: Document compare API is used to compare the differences between two text documents with similar content. Users need to provide two text documents with similar content. For example, document A and document B, the comparison result is provided in the form of an HTML page. The HTML page displays the original document and the comparison document, as well as their differences.

Usage: Access the following interface, which will return the comparison result page. Where docId and docIdB are the ids of document A and document B in the business system. (docId is the original document in the display page, docIdB is the comparison document in the display page)

http(s)://${zOffice_domain}/docs/app/driver-callback?repoId=${repoId}&docId=${docId}&docIdB=${docIdB}&action=compare&userinfo=${userInfo}&meta=${meta}&metaB=${metaB}&downloadUrl=${downloadUrl}&downloadUrlB=${downloadUrlB}&params=${params}&ts=${ts}&HMAC=${hmac}

Notes:

  1. Document compare API can only be called after users complete frontend integration for online editing.
  2. The corresponding parameters refer to Filez Document Platform - Integration Edition Third-party Frontend Integration Interface Documentation

Complete request parameter definitions are as follows:

Parameter NameRequiredDescription
repoIdYesThe unique identifier ID of the third-party service in zOffice, defined by the third-party service, and must be set in the management console.
docIdYesThe unique ID of the document in the third-party system, identifying the document docA ID to be compared
docIdBYesThe unique ID of the document in the third-party system, identifying the comparison document docB ID
actionYesIdentifies the action to open the document, value is compare
userinfoYesIdentifies the user information performing the operation, a base64-encoded JSON string. base64(JSON.stringify(userinfoObj)). Must use encodeURIComponent encoding before concatenating to URL
metaYesIdentifies the metadata of docA document, a base64-encoded JSON string. base64(JSON.stringify(metaObj)). Must use encodeURIComponent encoding before concatenating to URL
metaBYesIdentifies the metadata of docB document, a base64-encoded JSON string. base64(JSON.stringify(metaObj)). Must use encodeURIComponent encoding before concatenating to URL
downloadUrlYesThe address to download docA file stream. The corresponding URL address cannot use encodeURIComponent encoding, do not include request parameters, request parameters to be passed should be passed through params.
The host of downloadUrl must be consistent with the interface address prefix configured for this application in the management console. host includes hostname and port. If the host in downloadUrl does not include a port, the related configuration should not include a port either, even for default ports
downloadUrlBYesThe address to download docB file stream. The corresponding URL address cannot use encodeURIComponent encoding, do not include request parameters, request parameters to be passed should be passed through params.
The host of downloadUrl must be consistent with the interface address prefix configured for this application in the management console. host includes hostname and port. If the host in downloadUrl does not include a port, the related configuration should not include a port either, even for default ports
paramsNoInformation to be passed back, format key=value;key2=value2.
If the third-party system has permission verification when requesting downloadUrl and uploadUrl, please be sure to pass relevant identity information in params, otherwise the request will fail.
tsYesTimestamp when the URL was generated, precision in milliseconds
HMACYesSalted hash value of the request URL, used to verify whether the request address has been tampered with
Size Limit

Currently only supports doc /docx documents, size not exceeding 50M