> For the complete documentation index, see [llms.txt](https://docs.zus.network/features-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zus.network/features-documentation/sharing.md).

# Sharing

## Public File Sharing <a href="#id-5fkfvyecdwr6" id="id-5fkfvyecdwr6"></a>

To share files publicly, you must provide the allocation ID and remote path to retrieve the authTicket.

### AuthTicket format <a href="#lroxpwrce1dd" id="lroxpwrce1dd"></a>

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.

### File Sharing <a href="#id-4wu9mu9tlcul" id="id-4wu9mu9tlcul"></a>

To download a shared file; you can utilize the sdk.download function or consult the [CLI documentation](https://docs.zus.network/guides/zbox-cli/uploading-and-managing-files#download-using-authticket) for detailed instructions. The `authTicket` and `lookup_hash` must be provided as parameters when downloading the file.

### Folder Sharing <a href="#id-269erfizxx1m" id="id-269erfizxx1m"></a>

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:

{% code lineNumbers="true" %}

```
const blobber = getRandomArrayElement(allocationInfo.blobbers);
const params = `?path_hash=${lookup_hash}`;
const url = blobber.url + '/v1/file/list/' + allocationId + params; 
```

{% endcode %}

**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:

```
https://demo3.zus.network/blobber01/v1/file/list/7aa73fdd041d1982a183bab4f23e75f53a09df
8bdb689375ace9b45b130607cd?path_hash=22f2d545e2cc579c793b8e153c26226b6b5373bf23f5a661ba
e06a9897b2352c
```

## Private Sharing <a href="#nvpayhmkau3u" id="nvpayhmkau3u"></a>

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.

You can use the [corresponding API](https://0box.dev.zus.network/swagger/index.html#/getcontactwallets/getcontactwallets) to obtain additional details, such as the wallet ID and encryption key of the receiver.

## 0box Share APIs Documentation

### POST [v2/share/shareinfo](https://0box.dev.zus.network/swagger/index.html#/share/post_v2_share_shareinfo) <a href="#lsqy2d85wt5m" id="lsqy2d85wt5m"></a>

#### **Public Share**

We must pass the following data in the body as formdata; check [the swagger](https://0box.dev.zus.network/swagger/index.html#/share/post_v2_share_shareinfo) for more reference.

| Parameter            | Description                                  |
| -------------------- | -------------------------------------------- |
| 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 |

#### Private Share

We must pass the following data in the body as formdata; check [the swagger](https://0box.dev.zus.network/swagger/index.html#/share/post_v2_share_shareinfo) for more reference.

| Parameter            | Description          |
| -------------------- | -------------------- |
| auth\_ticket         | authTicket           |
| receiver\_client\_id | receiver's wallet id |

### DELETE [v2/share/shareinfo](https://0box.dev.zus.network/swagger/index.html#/share/delete_v2_share_shareinfo) <a href="#i56y7i6d54wb" id="i56y7i6d54wb"></a>

We can delete the share info by authTicket or lookup\_hash.

### GET <a href="#ed2ryle0vsf" id="ed2ryle0vsf"></a>

Check these endpoints on Swagger.

[/v2/share/shareinfo/received](https://0box.dev.zus.network/swagger/index.html#/share/get_v2_share_shareinfo_received) (also add lookup\_hash query param)

To get the list of users with access to the current file/folder.

This is the data I’m showing here.

![](https://github.com/0chain/gitbookdocs/blob/monorepo-sync-test/features-docs/broken-reference)

#### [/v2/share/shareinfo/shared](https://0box.dev.zus.network/swagger/index.html#/share/get_v2_share_shareinfo_shared) (Shared to me)

To get the list of private and public shared files.

[/v2/share/shareinfo/shared/public](https://0box.dev.zus.network/swagger/index.html#/share/get_v2_share_shareinfo_shared_public)

To get the list of only publicly shared files.

[/v2/share/shareinfo/shared/](https://0box.dev.zus.network/swagger/index.html#/share/get_v2_share_shareinfo_shared_public)private

The endpoint is not ready to get the list of only private shared files.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zus.network/features-documentation/sharing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
