# IRPCViews.EnableShareView

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Views](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/

Badges: `Vault API / standard` `write` `session or assertion` `returns metadata structure version`

Allows other users to copy the given private views of the caller for a limited time.

- **Service:** [Views](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/index.md) `MFiles.IRPCViews`
- **gRPC method:** `/MFiles.IRPCViews/EnableShareView`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/enable-share-view`
- **Request:** [`EnableShareViewRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/index.md#request)
- **Response:** [`EnableShareViewResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Only the caller's own private views can be shared; another user's view or a common view fails
  with "Access denied.".
- Sharing starts now and lasts the returned number of days. Calling again restarts the period.
- Other users take a copy with [CopyView](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/CopyView/index.md); the original view
  stays private.

<a id="request"></a>

## Request: EnableShareViewRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `views_count` | `uint32` | The number of entries in `shared_views`. Must match. |
| `shared_views[]` | repeated [`ItemID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemID/index.md) | The IDs (`internal_id`) of the views to share. |
| `shared_views[].internal_id` | `int32` | The ID of the object or value list item. |
| `shared_views[].external_repository_id` | [`ExternalRepositoryID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExternalRepositoryID/index.md) | Used only for objects in external repositories (external connectors). Leave it unset for objects stored in the vault. |
| `shared_views[].external_repository_id.connection` | `string` | The external repository connection identifier. |
| `shared_views[].external_repository_id.item` | `string` | External ID within the scope of the connection to external system. |

<a id="response"></a>

## Response: EnableShareViewResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `sharing_days` | `int32` | How many days other users can copy the views, as set by the vault administrator (14 by default). |

<a id="related"></a>

## Related methods

- [CopyView](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/CopyView/index.md): Copies a private view that another user has shared, with its child views, into the caller's own views.
