Batch FileHandle and File URL Services

Batch FileHandle and File URL Services

When we added the Bulk File Download feature we set up security infrastructure to allow users to download any Synapse file using the following triple: FileHandleAssociation.  This set the stage for building a new web-service that could replace the following calls with a single call:

API

Status

AssociationObjectId

AssociationObjectType

API

Status

AssociationObjectId

AssociationObjectType

GET /entity/{id}/file

REPLACED

entityId

FileEntity

GET /entity/{id}/version/{versionNumber}/file

REPLACED

entityId

FileEntity

GET /entity/{id}/filepreview







GET /entity/{id}/version/{versionNumber}/filepreview







GET /entity/{id}/filehandles

REPLACED

entityId

FileEntity

GET /entity/{id}/version/{versionNumber}/filehandles

REPLACED

entityId

FileEntity

GET /fileHandle/{handleId}/url

REPLACED





GET /file/{id}

REPLACED





GET /fileHandle/{handleId}

REPLACED





POST /entity/{id}/table/filehandles







GET /entity/{id}/table/column/{columnId}/row/{rowId}/version/{versionNumber}/file

REPLACED

entityId

TableEntity

GET /entity/{id}/table/column/{columnId}/row/{rowId}/version/{versionNumber}/filepreview







GET /team/{id}/icon

REPLACED

teamId

TeamAttachment

GET /userProfile/{profileId}/image

REPLACED

userId

UserProfileAttachment

GET /userProfile/{profileId}/image/preview







GET /entity/{ownerId}/wiki/{wikiId}/attachmenthandles

REPLACED

wikiId

WikiAttachment

GET /evaluation/{ownerId}/wiki/{wikiId}/attachmenthandles







GET /entity/{ownerId}/wiki/{wikiId}/attachment

REPLACED

wikiId

WikiAttachment

GET /evaluation/{ownerId}/wiki/{wikiId}/attachment







GET /evaluation/{ownerId}/wiki/{wikiId}/attachmentpreview







GET /entity/{ownerId}/wiki2/{wikiId}/attachmenthandles

REPLACED

wikiId

WikiAttachment

GET /access_requirement/{ownerId}/wiki2/{wikiId}/attachmenthandles







GET /evaluation/{ownerId}/wiki2/{wikiId}/attachmenthandles







GET /entity/{ownerId}/wiki2/{wikiId}/attachment

REPLACED

wikiId

WikiAttachment

GET /access_requirement/{ownerId}/wiki2/{wikiId}/attachment







GET /evaluation/{ownerId}/wiki2/{wikiId}/attachment







GET /entity/{ownerId}/wiki2/{wikiId}/attachmentpreview







GET /access_requirement/{ownerId}/wiki2/{wikiId}/attachmentpreview







GET /evaluation/{ownerId}/wiki2/{wikiId}/attachmentpreview







GET /entity/{ownerId}/wiki2/{wikiId}/markdown

REPLACED

wikiId

WikiMarkdown

GET /access_requirement/{ownerId}/wiki2/{wikiId}/markdown







GET /evaluation/{ownerId}/wiki2/{wikiId}/markdown







GET /message/{messageId}/file

REPLACED

messageId

MessageAttachment


Related Issues

Download Audit Record

For each file included in the results, an audit record will capture the following data:

  • FileHandleId

  • AssociatedObjectId

  • AssociatedObjectType

  • UserId

  • Timestamp

Object Model

Rest API

URL

Method

Request Body

Response Body

Authorization

Description

URL

Method

Request Body

Response Body

Authorization

Description

/filehandle/batch

POST

BatchFileRequest

BatchFileResult

Anyone

Call to request a batch of FileHandles, presignedUrls, or both.  A FileResult will be unconditionally returned for each FileRequest.  If the requested FileHandle does not exist then a failureCode=NOT_FOUND will be returned.  If the caller is not authorized to download a requested file then a failurecode=UNAUTHORIZED will be returned.  Returns status code: 201.  Limit of 100 FileRequests per call.