Hello @aclassen
Thank you for the summary of the subject, here are the answers to your questions :
Is a combination of those requests enough for a read-only access?
=> Yes absolutly, these 2 requests will allows you to download the file with the proper metadata
By using access from the Intranet for example with a curl library or the like, do I understand well that we could make the call going just between servers?
=> Yes, there is a simple exemple, assuming that you already retrieved the file name and knows the node ID :
$ch = curl_init();
$path = "/var/www/d7/sites/default/files/api/"; //An apache writable path on this server
$title = "Copies écran GoFAST.pptx"; //Retrieved using GET : api/node/node
//Set URLs and inform cURL this is a file transfer
curl_setopt($ch, CURLOPT_URL, "https://gofast.ceo-vision.com/api/node/content?nid=19840");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
//Set mandatory headers as described in the documentation
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/octet-stream",
"Content-Disposition: attachment",
"Authorization: XXXXXX" //Your user Authorization as described in the documentation
));
//Retrieve the file
$output = curl_exec($ch);
//Write the file in the server
file_put_contents($path . $title, $output);
curl_close($ch);
37e76174-94e2-489e-91f0-5f4f7c6eeec1-image.png
And we could have for example 2 users with different access rights – one for Extanet shared documents, one for the internal Organisations? Or does that not make sense?
=> Yes, multiple users with different Authorization can makes sense for security reasons, even if in practical, the front end users will never get the Authorization informations because all the work is done server side
I remember that you also mentioned that somehow the approach was simpler when restricting access to _Public spaces. Is that the case?
=> I'm not sure I remember but it might be the fact that a non extranet user in GoFAST have access to all public spaces
I regularly get the response message "This Content-Type is not implemented by the server" (as JSON) but the document downloads OK. Is that as expected?
=> Please set the headers as shown in the exemple
Don't hesitate to come back to me if you have further questions !