There are 2 ways to retrieve DbFile attachments.
Method 1:
Perform a GET call to the parent component expanding the DbFile relationship and you will get the file attachment in a base64 encoded string format. You can then decode this to retrieve the attached file.
Example GET call below to retrieve a single DbFile field attachment.
http://<WebApp_URL>/restapi/component/meeting_register(‘Bu89_55icMU-CqjbdIjs_Fai’)?$expand=rel_link_to_agenda
Example calls below to retrieve the DbFile attachment from within a File Storage subform record.
GET call to retrieve the UniqueId of the File Storage record
http://<WebApp_URL>/NetForms/restapi/component/incident('Bu89_55iyOripQjbbJUI4uwO')?$expand=rel_file_storage
Subsequent GET call passing in the UniqueId of the File Storage record and expanding the DbFile relationship.
http://<WebApp_URL>/NetForms/restapi/component/file('AKVUAu1-4WJYYAjb2ore7C8Z')?$expand=rel_attached_file
Method 2:
Perform a GET call to retrieve the UniqueId of the DbFile record and then a subsequent GET call to retrieve the RAW file data.
Example of a GET call below to retrieve UniqueId of a single DbFile field attachment
http://<WebApp_URL>/NetForms/restapi/component/meeting_register(‘Bu89_55icMU-CqjbdIjs_Fai’)?$expand=rel_link_to_agenda
Subsequent GET call passing in the UniqueId of the DbFile record
http://<WebApp_URL>/NetForms/restapi/component/dbfile(‘AKVUAu1-4WJYYAjb2ore7JXR’)/$value
To retrieve the RAW DbFile attachment from within a File Storage Subform record, perform a GET call expanding the DbFile relationship to get the UniqueId of the DbFile record.
http://<WebApp_URL>/NetForms/restapi/component/file('AKVUAu1-4WJYYAjb2ore7C8Z')?$expand=rel_attached_file
Subsequent GET call passing in the UniqueId of the DbFile record
http://<WebApp_URL>/NetForms/restapi/component/dbfile(‘AKVUAu1-4WJYYAjb2ore7JXR’)/$value
|