Generate a direct access/download content URL for the given file. This will enable downloading the file directly from Cloud storage such as AWS S3.
API Explorer URL: http://localhost:8080/api-explorer/#/nodes/requestNodeDirectAccessUrl
See also: the Direct Access URLs section in the Alfresco Content Connector for AWS S3 documentation.
The following HTTP POST call is used to download a file: http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/{nodeId}/request-direct-access-url
It is up to the actual ContentStore implementation if it can fulfil this request or not.
The POST body contains an attachment flag, which controls the download method of the generated URL. It defaults to true, meaning the value for the Content-Disposition response header will be attachment. true enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window.
You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response.
{ "attachment": true }
The following example gets a direct access URL for a text file with the d8f561cc-e208-4c63-a316-1ea3d3a4e10e Node Identifier:
$ curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Basic VElDS0VUXzA4ZWI3ZTJlMmMxNzk2NGNhNTFmMGYzMzE4NmNjMmZjOWQ1NmQ1OTM=' -d '{ "attachment": true}' 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/d8f561cc-e208-4c63-a316-1ea3d3a4e10e/request-direct-access-url' | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed { "entry": { "contentUrl": "https://<bucket_name>.s3.<region_name>.amazonaws.com/<binary_name>.bin?response-content-disposition=attachment%3B%20filename%20%3D%22graph.JPG%22&response-content-type=image%2Fjpeg&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEMv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMiJGMEQCIDmc%2Fb1e55l4sQjKGG3%2Fr1CU0gtzOOqFnr0Q%2BuXoNa%2BXAiB5oSPGJI1%2FZORobOtV%2BUmiim6GMQJxoKT9I%2Fn6t9ANvir6AwgUEAMaDDE3NTEyNTQyOTQ0MiIMA1qC5mzeuQ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%2Faws4_request&X-Amz-Signature=6b240b52024eca8a07e47dfad6970f84a75de049a1ae7af5855ed8c655f76cda", "attachment": true, "expiryTime": "2022-02-09T11:54:58.700+0000" } } Sample response for Azure Connector: { "entry": { "contentUrl": "https://<storage_account_name>.blob.core.windows.net/<container_name>/<blob_name>?sv=2020-10-02&spr=https&se=2022-02-09T04%3A09%3A40Z&sr=b&sp=r&sig=LkznZiG6u2BUDprdKyk0Hm9XkURG%2BZZp0qy0Ls3kgVY%3D&rscd=attachment%3B%20filename%20%3D%22graph.JPG%22&rsct=image%2Fjpeg", "attachment": true, "expiryTime": "2022-02-09T04:09:40.638+0000" } }