- Print
- DarkLight
- PDF
Visionneur de contenu externe
Viewing a document externally
This will ensure that the generated signature URL will be made from the reverse-proxy URL and not the internal URL of the Constellio server.
This can be very useful for exposing only that URL externally without exposing your entire Constellio server to the web.
This web service allows you to send a request to the server in order to obtain an embed link to the document viewer.
Identification is done by the Constellio token mechanic.
The following settings can be passed during calls:
Parameter | Description | Status |
---|---|---|
recordId (Path Variable) | The ID of the document. | Obligatory |
expiration | The expiration in seconds of the generated URL | Obligatory |
singleUse | If true, the generated URL can only be used once. The default value is false. | Facultative |
Example
Call
GET http://localhost:7070/constellio/rest/v2/documents/{recordId}/viewer?expiration=5000&singleUse=false
Answer
http://localhost:7070/constellio?isExternalContentViewer=true&documentId=A01_numericContractWithDifferentCopy&signature=rO0ABXQA7DM2NGsvUnY2aFpJVjB4d3R2UjFRZTgzZS9aOVh3Z1NjeVMxcmM3VnNjNVNkK205UVc5ZTV6YmFrdjExeDZTdW1Yd2pOZmluTm9pU2pvVTBCS0RZR1Rxa3pYWGt4UFNZWU1SVS9TMDdkcnBJVGxKbEVHcWxYcDliV2ZnOVVMWFNMN2JLY2NOZFptREVBa2x4a001cVZqdjAveVR5ZCs4SmpzWXRUemdwOGpJbXVJbW1FcE1aaVRqb2d3U3ZJdVpkTEUway8rbGQvVk5ud2ZvSVhtVDhwY0Z5ME9CaTRkRUlrSnB5emwybzNMSDQ9
iFrame
Simply create an iFrame on your site with the resulting URL as a source.
Example:
<!DOCTYPE html> <html> <body> <h2>HTML Iframes</h2><p>You can use the height and width attributes to specify the size of the iframe:</p> <iframe height="700" width="850" title="Iframe Example" src="http://localhost:7070/constellio?isExternalContentViewer=true&documentId=A01_numericContractWithDifferentCopy&signature=rO0ABXQA7DM2NGsvUnY2aFpJVjB4d3R2UjFRZTgzZS9aOVh3Z1NjeVMxcmM3VnNjNVNkK205UVc5ZTV6YmFrdjExeDZTdW1Yd2pOZmluTm9pU2pvVTBCS0RZR1Rxa3pYWGt4UFNZWU1SVS9TMDdkcnBJVGxKbEVHcWxYcDliV2ZnOVVMWFNMN2JLY2NOZFptREVBa2x4a001cVZqdjAveVR5ZCs4SmpzWXRUemdwOGpJbXVJbW1FcE1aaVRqb2d3U3ZJdVpkTEUway8rbGQvVk5ud2ZvSVhtVDhwY0Z5ME9CaTRkRUlrSnB5emwybzNMSDQ9"/> </body> </html>