Shared links (anonymous access) (IRPCSharedLinksPublic)
Opens and downloads files through shared links, without logging in.
| gRPC service | MFiles.IRPCSharedLinksPublic |
|---|---|
| Book and level | Vault API, standard |
| Methods | 7 |
| Proto file | mfiles/IRPCSharedLinksPublic.proto |
Overview
The anonymous side of shared links: opens and downloads a file shared with CreateSharedLink. No login and no session are needed; every call names the vault by its GUID and the link by its access key. Use it to build a download page for people outside the vault.
Public read-only link (SHARED_LINK_TYPE_READ_ONLY, or an external link open to anyone):
- GetSharedLinkInfo for the file name, extension and size.
- DownloadSharedFile_Begin for a download ID, the size and the MD5 checksum.
- DownloadSharedFile_ReadBlock in a loop until all bytes are read.
Link shared with named visitors (visitor links, and external links that are not open to anyone): the visitor proves their email address first.
- AccessSharedLink with the visitor's email address returns an access session value. If the address is a recipient of the link, the server emails an access code to it.
- Pass the address, the access code and the access session in
additional_dataof GetSharedLinkInfo and DownloadSharedFile_Begin, as NamedValue entries namedRECIPIENT_EMAIL,RECIPIENT_ACCESSCODEandACCESS_SESSION. Without them, an external link that is not open to anyone fails with "Authentication required to access the shared link.".
Shared links must be enabled on the server and in the vault. An unknown, deleted or expired access key fails with "The link is either expired or invalid.". The upload and WOPI methods serve co-authoring and Office for the web in M-Files clients; applications rarely call them.
Methods
| Method | Summary | Facts |
|---|---|---|
| AccessSharedLink | Starts a visitor's access to a link shared with named visitors: returns an access session value and, if the email address is a recipient of the link, emails an access code to it. | write no session |
| DownloadSharedFile_Begin | Starts downloading the file of a shared link, without logging in, and returns a download ID, the file size and its MD5 checksum. | write no session |
| DownloadSharedFile_ReadBlock | Reads one block of a file download started with DownloadSharedFile_Begin. | write no session |
| GetSharedLinkInfo | Gets the name, extension and size of the file that a shared link points to, without logging in. | write no session |
| GetWOPIFileInfo | Gets information about the file of a link for Office for the web (WOPI) operations. Used by M-Files clients; applications rarely call it. | write no session |
| UploadSharedFile | Uploads a block of new content for a file opened for editing in Office for the web. Used by M-Files clients; applications rarely call it. | write no session |
| UploadSharedFileCommit | Completes an upload made with UploadSharedFile and stores the content in the checked-out file. Used by M-Files clients; applications rarely call it. | write no session |