ATTACHMENT Strategy
Route ATTACHMENT
router.GET('attachment/{id}/{attachmentName}', {
strategy(ATTACHMENT) {
documentStrategy(DOCUMENT_BY_UNID) {
keyVariableName('id')
databaseName('names.nsf')
runAsSigner(true)
}
fieldName 'fieldname'
selectionType BY_NAME //Could be BY_NAME, FIRST
attachmentNameVariableName 'attachmentName'
}
})
Where id is the UNID of the document containing the attachment.
attachmentName is the filename of the attachement.
URL to call:
http://localhost/rest/myfirst.nsf/xsp/.xrest/attachment/DF45920D34609356C12588FB004B6EC7/example.txt