# IRPCEvents.TestMessageToUser

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) > [Events and notifications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEvents/index.md)

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

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

Checks whether a user can receive notifications, and fails with the reason when not.

- **Service:** [Events and notifications](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEvents/index.md) `MFiles.IRPCEvents`
- **gRPC method:** `/MFiles.IRPCEvents/TestMessageToUser`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/test-message-to-user`
- **Request:** [`TestMessageToUserRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEvents/TestMessageToUser/index.md#request)
- **Response:** [`TestMessageToUserResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEvents/TestMessageToUser/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

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

## Remarks

- Requires a vault session; anonymous sessions get "Access denied.".
- Checks, in this order: notifications are enabled on the server, notifications are enabled in
  the vault, event logging is enabled in the vault, the user has not turned notifications off
  (only with `test_notifications_disabled_by_user`), and the user has a valid e-mail address.
  The first failed check is the error, for example "Please ask your M-Files admin to enable
  notifications on the M-Files server.".
- Nothing is sent. `send_message` true fails with "Not implemented.".

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

## Request: TestMessageToUserRequest

> 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 |
|---|---|---|
| `user_id` | `int32` | The ID of the user account to check, or -1 for the caller. |
| `test_notifications_disabled_by_user` | `bool` | True to also fail when the user has turned notifications off. Leave false to check only whether requests can reach the user. |
| `send_message` | `bool` | Must be false; sending a test message is not supported. |

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

## Response: TestMessageToUserResponse

No fields.
