Visionneur de contenu externe
  • 07 Dec 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Visionneur de contenu externe

  • Dark
    Light
  • PDF

Article summary

Viewing a document externally

Use with reverse-proxy
If the feature is used with a reverse-proxy, please make sure that the reverse-proxy feeds the X-Forwarded-Host http header.
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:


ParameterDescriptionStatus
recordId (Path Variable)The ID of the document.Obligatory
expirationThe expiration in seconds of the generated URL Obligatory
singleUseIf 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>

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.