> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.IPocketAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent">\</a> Interface IPocketAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Agent with Pocket specific functionality

```csharp theme={null}
public interface IPocketAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_GetCallerIDsFromSelectionAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCallerIDsFromSelectionAsync(int, string, RequestOptions)

Get caller ids from a selection. Queries the shadow selection of persons and companies, so selections of any kind can be used

```csharp theme={null}
Task<CallerIDCollection> GetCallerIDsFromSelectionAsync(int selectionId, string lastHash, RequestOptions requestOptions = null)
```

#### Parameters

`selectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of selection to get caller ids from

`lastHash` [string](https://learn.microsoft.com/dotnet/api/system.string)

Hash for the previous call, used for checking if the same set of caller ids was sent in an earlier call, and returning null in that case

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CallerIDCollection](SuperOffice.WebApi.Data.CallerIDCollection.md)\&gt;

Collection of caller IDs, containing the hash of the caller ids

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_GetMyCallerIDsAsync\_System\_String\_System\_DateTime\_System\_DateTime\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetMyCallerIDsAsync(string, DateTime, DateTime, RequestOptions)

Get caller ids that the current principal might be interested in (phone numbers of related persons in sales and appointments created/owned/touched by ourselves or colleagues in our primary group

```csharp theme={null}
Task<CallerIDCollection> GetMyCallerIDsAsync(string lastHash, DateTime minDate, DateTime maxDate, RequestOptions requestOptions = null)
```

#### Parameters

`lastHash` [string](https://learn.microsoft.com/dotnet/api/system.string)

Hash for the previous call, used for checking if the same set of caller ids was sent in a previous call, and returning null in that case

`minDate` [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

Only check activities after this date

`maxDate` [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

Only check activities before this date

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CallerIDCollection](SuperOffice.WebApi.Data.CallerIDCollection.md)\&gt;

Collection of caller IDs, containing the hash of the caller ids

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_GetPocketStartupDataAsync\_System\_String\_\_\_System\_DateTime\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPocketStartupDataAsync(string\[], DateTime, RequestOptions)

```csharp theme={null}
Task<PocketStartupData> GetPocketStartupDataAsync(string[] tables, DateTime currentClientTime, RequestOptions requestOptions = null)
```

#### Parameters

`tables` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

Tables to check for license

`currentClientTime` [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

Current time on the client, used for overdue sale lookup having correct timezone relative to client

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PocketStartupData](SuperOffice.WebApi.Data.PocketStartupData.md)\&gt;

Startup data for pocket

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_GetPushNotificationTagsForDeviceAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPushNotificationTagsForDeviceAsync(string, RequestOptions)

Retrieve current tag value for a device

```csharp theme={null}
Task<string> GetPushNotificationTagsForDeviceAsync(string deviceIdentifier, RequestOptions requestOptions = null)
```

#### Parameters

`deviceIdentifier` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique identifier of this device

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

A comma separated list of events this device should receive push events for

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_GetRegisteredDevicesAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetRegisteredDevicesAsync(int, RequestOptions)

Retrieve all registered devices for an associate

```csharp theme={null}
Task<PocketDeviceInfo[]> GetRegisteredDevicesAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

`associateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The user to get devices for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PocketDeviceInfo](SuperOffice.WebApi.Data.PocketDeviceInfo.md)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_NotificationHandledAsync\_SuperOffice\_WebApi\_Data\_NotificationEventType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> NotificationHandledAsync(NotificationEventType, int, RequestOptions)

Mark a notification as handled, so it can be cleaned up on other clients that have received the notification

```csharp theme={null}
Task NotificationHandledAsync(NotificationEventType notificationEventType, int id, RequestOptions requestOptions = null)
```

#### Parameters

`notificationEventType` [NotificationEventType](SuperOffice.WebApi.Data.NotificationEventType.md)

Type of notification

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of entity to notify about

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_NotificationsHandledAsync\_SuperOffice\_WebApi\_Data\_NotificationEvent\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> NotificationsHandledAsync(NotificationEvent\[], RequestOptions)

Mark a set of notifications as handled, so they can be cleaned up on other clients that have received the notification

```csharp theme={null}
Task NotificationsHandledAsync(NotificationEvent[] notificationEvents, RequestOptions requestOptions = null)
```

#### Parameters

`notificationEvents` [NotificationEvent](SuperOffice.WebApi.Data.NotificationEvent.md)\[]

List of notifications to mark as handled

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_NotifyUsersAsync\_SuperOffice\_WebApi\_Data\_NotificationEventType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> NotifyUsersAsync(NotificationEventType, int, RequestOptions)

Notify users about a new or changed entity

```csharp theme={null}
Task NotifyUsersAsync(NotificationEventType notificationEventType, int id, RequestOptions requestOptions = null)
```

#### Parameters

`notificationEventType` [NotificationEventType](SuperOffice.WebApi.Data.NotificationEventType.md)

Type of notification

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of entity to notify about

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_RegisterDeviceForPushNotificationAsync\_SuperOffice\_WebApi\_Data\_PocketDeviceInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegisterDeviceForPushNotificationAsync(PocketDeviceInfo, RequestOptions)

Register a device that should receive push notifications when notable events occour

```csharp theme={null}
Task RegisterDeviceForPushNotificationAsync(PocketDeviceInfo deviceInfo, RequestOptions requestOptions = null)
```

#### Parameters

`deviceInfo` [PocketDeviceInfo](SuperOffice.WebApi.Data.PocketDeviceInfo.md)

Properties for the device to register

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_RunAppointmentAlarmBrokerAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RunAppointmentAlarmBrokerAsync(RequestOptions)

Execute the AppointmentAlarmBroker once

```csharp theme={null}
Task RunAppointmentAlarmBrokerAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_SendPushNotificationAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_Data\_PocketNotificationMessage\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendPushNotificationAsync(int\[], PocketNotificationMessage, RequestOptions)

Send a push notification to one or more associates

```csharp theme={null}
Task SendPushNotificationAsync(int[] associateIds, PocketNotificationMessage message, RequestOptions requestOptions = null)
```

#### Parameters

`associateIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The associates to send the push notification message to

`message` [PocketNotificationMessage](SuperOffice.WebApi.Data.PocketNotificationMessage.md)

The message to send

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_SetPushNotificationTagsForDeviceAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetPushNotificationTagsForDeviceAsync(string, string, RequestOptions)

Specify what kind of notification events a device should receive push notifications for

```csharp theme={null}
Task SetPushNotificationTagsForDeviceAsync(string deviceIdentifier, string tags, RequestOptions requestOptions = null)
```

#### Parameters

`deviceIdentifier` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique identifier for a device

`tags` [string](https://learn.microsoft.com/dotnet/api/system.string)

A comma separated list of events this device should receive push events for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IPocketAgent\_SetPushNotificationTagsForUserAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetPushNotificationTagsForUserAsync(int, string, RequestOptions)

Specify what kind of notification events a user should receive push notifications for.  This will update all registerred devices for this user.

```csharp theme={null}
Task SetPushNotificationTagsForUserAsync(int associateId, string tags, RequestOptions requestOptions = null)
```

#### Parameters

`associateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The associate to set tags for

`tags` [string](https://learn.microsoft.com/dotnet/api/system.string)

A comma separated list of events the associate should receive push events for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value


## Related topics

- [SuperOffice.WebApi.Agents.PocketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PocketAgent.md)
- [SuperOffice.WebApi.Data.PocketDeviceInfo](/en/api/reference/webapi/SuperOffice.WebApi.Data.PocketDeviceInfo.md)
- [SuperOffice.WebApi.Data.PocketNotificationMessage](/en/api/reference/webapi/SuperOffice.WebApi.Data.PocketNotificationMessage.md)
- [SuperOffice.WebApi.Data.PocketStartupData](/en/api/reference/webapi/SuperOffice.WebApi.Data.PocketStartupData.md)
- [SuperOffice.WebApi.Agents.DiagnosticsAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.DiagnosticsAgent.md)
- [SuperOffice.WebApi.Agents.IDiagnosticsAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IDiagnosticsAgent.md)
