---
title: "Class RealtimeRequest"
slug: "sdk--stylelabs.m.sdk.models.notifications.realtimerequest"
abstract: ""
---
# Class RealtimeRequest

Base class for real-time notification (browser notification) requests.

## Inheritance

object

RealtimeRequest

[RealtimeRequestBroadcast](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbroadcast.html)

[RealtimeRequestById](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbyid.html)

[RealtimeRequestByUsername](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbyusername.html)

## Implements

[IRealtimeRequest](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html)

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsNotifications

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public abstract class RealtimeRequest : IRealtimeRequest
```

## Properties

### [Link](https://doc.sitecore.com/ch/en/developers/api-reference/web-sdk--stylelabs.m.base.web.api.models.link.html)

Gets or sets the target when the notification is clicked.

#### Declaration

```csharp
public Uri Link { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| Uri |  |

### [NotificationLevel](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.notificationlevel.html)

Gets or sets the notification level.

#### Declaration

```csharp
public NotificationLevel NotificationLevel { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [NotificationLevel](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.notificationlevel.html) |  |

### Options

Gets or sets the notification options. This directly maps to the notification API standard used by browsers. See [https://developer.mozilla.org/en-US/docs/Web/API/notification](https://developer.mozilla.org/en-US/docs/Web/API/notification) for more information.

#### Declaration

```csharp
public JObject Options { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| JObject |  |

### Title

Gets or sets the title of the notification.

#### Declaration

```csharp
public string Title { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| string |  |

## Methods

### GetBody()

Gets the notification body from the [Options](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html) object.

#### Declaration

```csharp
public string GetBody()
```

#### Returns

| Type | Description |
| --- | --- |
| string | The notification body. |

### GetIcon()

Gets the notification icon from the [Options](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html) object.

#### Declaration

```csharp
public string GetIcon()
```

#### Returns

| Type | Description |
| --- | --- |
| string | The notification icon. |

### SetBody(string)

Sets the notification body on the [Options](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html) object.

#### Declaration

```csharp
public void SetBody(string body)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | body | The notification body. |

### SetIcon(string)

Sets the notification icon on the [Options](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html) object.

#### Declaration

```csharp
public void SetIcon(string icon)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | icon | The notification icon. |

### Validate()

Validates the real-time request.

#### Declaration

```csharp
public abstract void Validate()
```

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When the request has invalid properties. |

### Implements

[IRealtimeRequest](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.irealtimerequest.html)
