Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

File Sharing

Jessica Castrogiovanni edited this page Dec 21, 2016 · 1 revision

File Sharing

Purpose

The File Sharing API handles file management in the SnapMD platform. For the most part, these endpoints are found under the "filesharing" resource, but they will likely be standardized under the "files" endpoint in a later version of the API. Profile images are not currently placed under the File Sharing API, but may be in the future.

Endpoint List

  • v2/documents/{documentType}/hospitals/{hospitalId}
  • v2/filesharing/file/{fileSharingType}/{fileId}
  • v2/filesharing/file/{fileSharingType}/{fileId}/attach/{consultationId}
  • v2/filesharing/file/{fileSharingType}/{fileId}/copy/{targetFolderId}
  • v2/filesharing/file/{fileSharingType}/{fileId}/share
  • v2/filesharing/file/{fileSharingType}/{uploadFolderId}
  • v2/filesharing/folder/{fileSharingType}
  • v2/filesharing/folder/{fileSharingType}/{folderId}
  • v2/filesharing/folder/{fileSharingType}/{folderId}/copy/{targetFolderId}
  • v2/filesharing/folder/{fileSharingType}/tag
  • v2/filesharing/folder/admin
  • v2/publicdocuments
  • v2.1/filesharing/downloads
  • v2.1/filesharing/downloads/{downloadId}
  • v2.1/filesharing/files/{fileId}/history
  • v2.1/filesharing/files/{fileId}/restore
  • v2.1/filesharing/files/download/{filePublicLinkId}
  • v2.1/filesharing/files/move
  • v2.1/images/{id}

Recipes

Any endpoints that handle administrative functions are listed under the "Administrative Functions" page.

Document Types

Use GET on one of the following endpoints to retrieve information about a specified document type which is used by a particular hospital.

  1. v2/documents/{documentType}/hospitals/{hospitalId}
  2. v2/publicdocuments

File and Folder Manipulation

  1. Use POST v2/filesharing/file/{fileSharingType}/{fileId}/attach/{consultationId} to attach a file to an encounter.
  2. Use POST v2/filesharing/file/{fileSharingType}/{fileId}/copy/{targetFolderId} to attach a copay of a file to an encounter.
  3. Use GET or POST v2/filesharing/folder/{fileSharingType} to access or create the user's home folder.
  4. Use GET or DELETE v2/filesharing/folder/{fileSharingType}/{folderId} to access or delete a folder by ID.
  5. Use POST v2/filesharing/folder/{fileSharingType}/{folderId}/copy/{targetFolderId} to copy a file between folders.
  6. Use GET v2.1/filesharing/files/{fileId}/history to get the history of a file by its ID.
  7. Use POST v2.1/filesharing/files/{fileId}/restore to restore a previously deleted file.
  8. Use POST 2.1/filesharing/files/move to move a file between folders.

Profile Images

Use GET v2.1/images{id} to get a profile image by its ID.

Searching Files and Folders

  1. Use GET v2/filesharing/folder/{fileSharingType}/tag to search for folders using a tag.

Uploading and Downloading Files

  1. Use POST v2/filesharing/file/{fileSharingType}/{uploadFolderId} to upload a file to a particular folder.
  2. Use GET v2/filesharing/file/{fileSharingType}/{fileId} to get a download link for a particular file ID.
  3. Use POST v2.1/filesharing/downloads to download a file.
  4. Use GET v2.1/filesharing/downloads/{downloadId} to access a downloaded file.
  5. Use GET v2.1/filesharing/files/download/{filePublicLinkId} to get the content of a downloaded file.
  6. Use GET v2/filesharing/file/{fileSharingType}/{fileId}/share to get a link with which to share a file.

Clone this wiki locally