Sharing
The following documentation provides information on how to use the file-sharing feature within our SDK. To share files, an authTicket is required. You can obtain the authTicket by using the sdk.share
Last updated
The following documentation provides information on how to use the file-sharing feature within our SDK. To share files, an authTicket is required. You can obtain the authTicket by using the sdk.share
Last updated
To share files publicly, you must provide the allocation ID and remote path to retrieve the authTicket.
The authTicket is encoded in Base64 format. To access the information contained within the authTicket, you can decode it to retrieve the following details:
ā actual_file_hash:
The actual hash of the shared file.
ā file_name
: The name of the shared file.
ā reference_type
: Indicates whether it is a file or a folder.
ā expiration
: The duration for which the authTicket remains valid.
ā timestamp
: The timestamp when the authTicket was created.
ā encrypted:
Indicates whether the authTicket is encrypted. If set to true, the sharing is private.
ā signature
: The signature of the authTicket.
To download a shared file; you can utilize the sdk.download function or consult the for detailed instructions. The authTicket
and lookup_hash
must be provided as parameters when downloading the file.
To list the files within a shared folder, the following information is required:
ā Auth Ticket
ā Lookup Hash
ā Wallet ID of the owner
ā Allocation ID of the owner
The lookup_hash can be obtained from the authTicket using the file_path_hash attribute. Similarly, the wallet_id and allocation_id can be extracted from the authTicket.
To list the files within the shared folder, you must retrieve the allocation (blobbers) details using the sdk.getAllocation function or the allocation details API. After that, you can select a random blobber from the allocation details. Each blobber has a URL, which needs to be combined with the endpoint "/v1/file/list/" to obtain the list of files.
Example code:
Note: When making the request, make sure to include the wallet ID of the owner in the headers using `X-App-Client-ID`
.
A complete URL for listing the files may look like this:
To share files privately, you need to provide the allocation ID, remotePath, wallet ID of the receiver, and the encryption public key of the receiver to retrieve the authTicket.
auth_ticket
authTicket
from_info
wallet id of the user who makes this request
receiver_client_id
wallet id of the user who makes this request
auth_ticket
authTicket
receiver_client_id
receiver's wallet id
We can delete the share info by authTicket or lookup_hash.
Check these endpoints on Swagger.
To get the list of users with access to the current file/folder.
This is the data Iām showing here.
To get the list of private and public shared files.
To get the list of only publicly shared files.
The endpoint is not ready to get the list of only private shared files.
You can use the to obtain additional details, such as the wallet ID and encryption key of the receiver.
We must pass the following data in the body as formdata; check for more reference.
We must pass the following data in the body as formdata; check for more reference.
(also add lookup_hash query param)
private