This is a sub-task of .

Overview

We have a need for storing non-JSON files accessible only to the participant that submitted it. One example use case is skin plaque photos from the Psorcast app.

This is similar to the File Service API in that both allow you to submit and retrieve blob data to Bridge, but this new API is scoped to a participant.

This is similar to Participant Reports (and is largely intended to supplement the Participant Reports), but is different in two key ways: First, it’s blob data instead of JSON. Second, it’s not keyed to a date or timestamp.

This API will use S3 as the backing store and provide an API to upload and download the files. (S3 Presigned URLs will be used for the actual upload and download.) DynamoDB will be used to index the files, with the participant healthcode as the hash key (EDIT: user ID or health code?) and the file ID as the range key.

Other Considerations

REST API

Method

URL

Description

Permissions

GET

/v3/participants/self/files?offsetKey=<key>&pageSize=<size>

Paginated API to return a list of file metadata. (Does not create pre-signed URLs.)

participant

GET

/v3/participants/self/files/<file ID>

Returns an HTTP 302 w/ a redirect to the the S3 pre-signed URL for download.

participant

POST

/v3/participants/self/files/<file ID>

Writes the file to the index and returns the S3 pre-signed URL for upload.

participant

DELETE

/v3/participants/self/files/<file ID>

Physically deletes the file in both the index and in S3.

participant