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}¶ms=${params}&ts=${ts}&HMAC=${hmac}
Notes:
- Document compare API can only be called after users complete frontend integration for online editing.
- The corresponding parameters refer to Filez Document Platform - Integration Edition Third-party Frontend Integration Interface Documentation
Complete request parameter definitions are as follows:
| Parameter Name | Required | Description |
|---|---|---|
| repoId | Yes | The unique identifier ID of the third-party service in zOffice, defined by the third-party service, and must be set in the management console. |
| docId | Yes | The unique ID of the document in the third-party system, identifying the document docA ID to be compared |
| docIdB | Yes | The unique ID of the document in the third-party system, identifying the comparison document docB ID |
| action | Yes | Identifies the action to open the document, value is compare |
| userinfo | Yes | Identifies the user information performing the operation, a base64-encoded JSON string. base64(JSON.stringify(userinfoObj)). Must use encodeURIComponent encoding before concatenating to URL |
| meta | Yes | Identifies the metadata of docA document, a base64-encoded JSON string. base64(JSON.stringify(metaObj)). Must use encodeURIComponent encoding before concatenating to URL |
| metaB | Yes | Identifies the metadata of docB document, a base64-encoded JSON string. base64(JSON.stringify(metaObj)). Must use encodeURIComponent encoding before concatenating to URL |
| downloadUrl | Yes | The 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 |
| downloadUrlB | Yes | The 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 |
| params | No | Information 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. |
| ts | Yes | Timestamp when the URL was generated, precision in milliseconds |
| HMAC | Yes | Salted hash value of the request URL, used to verify whether the request address has been tampered with |
Currently only supports doc /docx documents, size not exceeding 50M