Toggle menu

generateSecureFileReferences

Generates a secure file reference for a file, as identified by its fileID. Multiple files IDs can be generated in a single call.

A link containing a secure reference can be returned to a site user, the service at the other end of the link can then call unpackSecureFileReferences to decrypt the ID, get the content from the filestore and return it to the user.

Request Parameters

NameTypeComments
userNameString, requiredThe name of the user the secure file reference is being generated for. Needed to decrypt the reference
fileIDsArray<UUID>, requiredThe file IDs to generate secure references for
validityPeriodMinsInteger, optionalThe number of minutes the secure reference will be valid for. The decryption method will not decrypt an expired reference. Uses the default set in the worker configuration if not supplied
formSessionIdString<UUID>, optionalUsed in combination with formsServiceClientIdCookie in unpackSecureFileReferences to secure the file reference to the supplied UUID. If not set no additional check is made (note that the form family's upload field and handlebars helpers only set the goss-formsservice-clientid cookie if the user is not logged in and the form is in "normal" rendering mode. If the user is logged their regular session identifier is used)

Example Request

{
    "id": "testreq1",
    "method": "generateSecureFileReferences",
    "params": {
        "userName": "joebloggs",
        "fileIDs": ["20296502-C509-4178-8EDE-841048AAF984"],
        "validityPeriodMins": 15
    },
    "jsonrpc": "2.0"
}

Example Response

{
    "result": {
        "result": {
            "20296502-C509-4178-8EDE-841048AAF984": {
                "success": true,
                "secureReference": "SFR-y4JA6wHgK8hea-zOr7BgCZH9TF3KDy1KA9ZVYehWU65DOPTnPO3gLfddL0KHUsC8hFohe9jOt1C-zktKd7orMNjgh00132hEDwrwNP_srd4AfJEy1QeXbA"
            }
        }
    },
    "id": "testreq1",
    "jsonrpc": "2.0"
}

Last modified on 27 June 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon