# IRPCWOPIOperations.CreateContainerAccessToken

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [WOPI operations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/index.md)

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

Badges: `Server integration API / specialized` `internal: not for applications` `write` `session`

Creates, or returns the existing, container access token with which the Office mobile apps
browse a vault location through the M-Files WOPI service.

- **Service:** [WOPI operations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/index.md) `MFiles.IRPCWOPIOperations`
- **gRPC method:** `/MFiles.IRPCWOPIOperations/CreateContainerAccessToken`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/create-container-access-token`
- **Request:** [`CreateContainerAccessTokenRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateContainerAccessToken/index.md#request)
- **Response:** [`CreateContainerAccessTokenResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperations/CreateContainerAccessToken/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

**For M-Files components only.** The M-Files WOPI service calls it after it has logged in for an
Office mobile app user. Applications should not call it.
- Requires a vault session. If the same session already has an unexpired token for the same
  path, that token is returned.
- The token expires 24 hours after it was created (the default; the server administrator can
  change it). Use it with
  [GetContainerInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerInfo/index.md) and
  [GetContainerContent](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerContent/index.md).

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

## Request: CreateContainerAccessTokenRequest

> 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 |
|---|---|---|
| `container_path` | `string` | The container path as the M-Files WOPI service forms it (at most 250 characters). |

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

## Response: CreateContainerAccessTokenResponse

> 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 |
|---|---|---|
| `wopi_container_token_info` | [`WOPIContainerTokenInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WOPIContainerTokenInfo/index.md) | The token, the session's user ID, user name and email address, and the expiration time (UTC). |
| `wopi_container_token_info.container_access_token` | `string` | The container access token. |
| `wopi_container_token_info.user_id` | `string` | The user id. |
| `wopi_container_token_info.user_name` | `string` | The user name. |
| `wopi_container_token_info.email_id` | `string` | The user's email id. |
| `wopi_container_token_info.expiration_time` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The container access token expiration time in UTC. |

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

## Related methods

- [IRPCWOPIOperationsPublic.GetContainerInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerInfo/index.md): Gets the name and path of the vault location (container) of a container access token.
- [IRPCWOPIOperationsPublic.GetContainerContent](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/GetContainerContent/index.md): Lists the subcontainers and files of the vault location (container) of a container access token.
