Unpacks a secure file reference for a file which has previously been generated using generateSecureFileReferences. Multiple file references can be unpacked in a single call.
Request Parameters
Name | Type | Comments |
---|---|---|
userNames | Array<String>, required | Usernames to use to decrypt the reference, typically the name of the currently logged in user and perhaps the anonymous user. Must match the username supplied when the reference was generated for decryption to be successful |
secureReferences | Array<String>, required | The secure references to unpack |
formsServiceClientIdCookie | String<UUID>, optional | Used in combination with |
Error Types
The errorType field of the part of the response corresponding to a specific reference to be unpacked may contain any of the following strings.
Error Type | Description |
---|---|
NOT_FOUND | The reference was unpacked but refers to a file that does not exist in the database |
EXPIRED | The reference was unpacked but has expired |
BAD_FORMAT | The reference was not of the expected format, eg did not contain the expected prefix "SFR-" |
FAILED | The reference could not be unpacked, most likely because none of the supplied usernames matched the one it was encrypted with, but all other errors are also covered by this case |
UNAUTHORIZED | The formsServiceClientIdCookie checking failed |
Example Request
{
"id": "testreq1",
"method": "unpackSecureFileReferences",
"params": {
"userNames": ["joebloggs", "anonymous"],
"secureReferences": ["SFR-AmNZEGKPzjv6gOioph6GhBHZKloRnL7W6RnRAMmO_T6uQvRC0XiI3Y2K0s9IJnRtsMaN0yBJez6ynPdiaTBpOr-VVIBJ14LEXjmc0CgLIJLaj0jZz5GY6g"]
},
"jsonrpc": "2.0"
}
Example Response
{
"result": {
"result": {
"SFR-AmNZEGKPzjv6gOioph6GhBHZKloRnL7W6RnRAMmO_T6uQvRC0XiI3Y2K0s9IJnRtsMaN0yBJez6ynPdiaTBpOr-VVIBJ14LEXjmc0CgLIJLaj0jZz5GY6g": {
"success": true,
"fileID": "20296502-c509-4178-8ede-841048aaf984"
}
}
},
"id": "testreq1",
"jsonrpc": "2.0"
}