> ## 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.IDiagnosticsAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent">\</a> Interface IDiagnosticsAgent

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

Diagnostics, usage data collection, caches and flushing

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

#### Implements

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

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_AddWebAppUsageAsync\_SuperOffice\_WebApi\_Data\_WebAppUsage\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AddWebAppUsageAsync(WebAppUsage\[], RequestOptions)

Adds WebApp usage to existing log

```csharp theme={null}
Task AddWebAppUsageAsync(WebAppUsage[] webAppUsages, RequestOptions requestOptions = null)
```

#### Parameters

`webAppUsages` [WebAppUsage](SuperOffice.WebApi.Data.WebAppUsage.md)\[]

Web app usage.

`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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_ChangeLogSettingsAsync\_System\_Boolean\_System\_Boolean\_System\_Boolean\_System\_Boolean\_System\_Boolean\_System\_Boolean\_System\_Boolean\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeLogSettingsAsync(bool, bool, bool, bool, bool, bool, bool, bool, RequestOptions)

Change NetServer log settings.

```csharp theme={null}
Task ChangeLogSettingsAsync(bool logWarning, bool logInformation, bool logSuccessAudit, bool logFailureAudit, bool logToEventLog, bool logToSuperOffice, bool logToFile, bool logToTrace, RequestOptions requestOptions = null)
```

#### Parameters

`logWarning` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Turn on warning log

`logInformation` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Turn on information log

`logSuccessAudit` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Turn on success audit log

`logFailureAudit` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Turn on failure audit log

`logToEventLog` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Log to event log

`logToSuperOffice` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Log to SuperOffice

`logToFile` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Log to file

`logToTrace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Log to trace

`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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_CollectDataAdditionsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CollectDataAdditionsAsync(RequestOptions)

Collect and transmit usage statistics: Database Additions. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.

```csharp theme={null}
Task CollectDataAdditionsAsync(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\_IDiagnosticsAgent\_CollectTableSizesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CollectTableSizesAsync(RequestOptions)

Collect and transmit usage statistics: Table Sizes. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.

```csharp theme={null}
Task CollectTableSizesAsync(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\_IDiagnosticsAgent\_CollectWebUsageAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CollectWebUsageAsync(RequestOptions)

Collect and transmit usage statistics: Web-based clients Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.

```csharp theme={null}
Task CollectWebUsageAsync(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\_IDiagnosticsAgent\_CollectWinUsageAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CollectWinUsageAsync(RequestOptions)

Collect and transmit usage statistics: Windows CRM Client Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.

```csharp theme={null}
Task CollectWinUsageAsync(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\_IDiagnosticsAgent\_FlushCachesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FlushCachesAsync(RequestOptions)

Flushes all NetServer caches

```csharp theme={null}
Task FlushCachesAsync(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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_FlushCachesByNameAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FlushCachesByNameAsync(string\[], RequestOptions)

Flushes all NetServer caches named

```csharp theme={null}
Task FlushCachesByNameAsync(string[] cacheNames, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of the cachnes to flush

`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\_IDiagnosticsAgent\_GetAnalyticsDataAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAnalyticsDataAsync(RequestOptions)

Retrieve analytics properties to be included in usage tracking.

```csharp theme={null}
Task<AnalyticsData> GetAnalyticsDataAsync(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-1)\<[AnalyticsData](SuperOffice.WebApi.Data.AnalyticsData.md)\&gt;

Description Analytics Data

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetCacheInvalidationGenerationsAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCacheInvalidationGenerationsAsync(string\[], RequestOptions)

Get generation for provided names

```csharp theme={null}
Task<CacheInvalidation[]> GetCacheInvalidationGenerationsAsync(string[] names, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of caches

`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)\<[CacheInvalidation](SuperOffice.WebApi.Data.CacheInvalidation.md)\[]\&gt;

Array of caches with generation number

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetCacheNamesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCacheNamesAsync(RequestOptions)

Get the name of the caches that can be flushed

```csharp theme={null}
Task<string[]> GetCacheNamesAsync(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-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

Name of the caches that can be flusehd

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetCacheStateAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCacheStateAsync(string\[], RequestOptions)

Get the current generation value of the named caches. State is opaque.

```csharp theme={null}
Task<string> GetCacheStateAsync(string[] cacheNames, RequestOptions requestOptions = null)
```

#### Parameters

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

Names of the caches to check

`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;

Current state of the caches named. If not the same as previous value, then it is time to flush

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetEntityCountsForAllUsersAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEntityCountsForAllUsersAsync(RequestOptions)

Get an array of entities and number of entities created for all associates.

```csharp theme={null}
Task<EntityCounts[]> GetEntityCountsForAllUsersAsync(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-1)\<[EntityCounts](SuperOffice.WebApi.Data.EntityCounts.md)\[]\&gt;

Array of EntityCounts\[] for all the users

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetEntityCountsForCurrentUserAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEntityCountsForCurrentUserAsync(RequestOptions)

Get an array of entities and number of entities created for the current associate

```csharp theme={null}
Task<EntityCounts[]> GetEntityCountsForCurrentUserAsync(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-1)\<[EntityCounts](SuperOffice.WebApi.Data.EntityCounts.md)\[]\&gt;

Array of EntityCounts\[] for the current associate

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetNextTableNumberAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNextTableNumberAsync(RequestOptions)

Increment save and return NextTableNumber, to be used when creating new extra table

```csharp theme={null}
Task<int> GetNextTableNumberAsync(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-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

NextTableNumber of DatabaseModel

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_GetSystemMessagesAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSystemMessagesAsync(int, RequestOptions)

Retrieves a list of system messages for a specific associate.

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

#### Parameters

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

The associateId of the message target.

`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)\<[SystemMessage](SuperOffice.WebApi.Data.SystemMessage.md)\[]\&gt;

List of SystemMessages for desired associate

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

Get all WebAppUsages for a given period, that match an optional search term

```csharp theme={null}
Task<WebAppUsage[]> GetWebAppUsagesForPeriodAsync(DateTime fromDate, DateTime toDate, string searchTerm, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

ViewState search term. '%' is the wildcard character, for example 'Pocket%' will match all viewstates starting with 'Pocket'. If empty, all viewstates will be matched

`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)\<[WebAppUsage](SuperOffice.WebApi.Data.WebAppUsage.md)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_LogViewStateAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> LogViewStateAsync(string, RequestOptions)

Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.

```csharp theme={null}
Task LogViewStateAsync(string viewState, RequestOptions requestOptions = null)
```

#### Parameters

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

Current view state to be logged

`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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_PerformTasksAfterCustomObjectTableCreatedAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> PerformTasksAfterCustomObjectTableCreatedAsync(string, RequestOptions)

A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer

```csharp theme={null}
Task PerformTasksAfterCustomObjectTableCreatedAsync(string tableName, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of DB table of the custom object that was created. E.g., 'y\_car'

`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\_IDiagnosticsAgent\_PerformTasksAfterCustomObjectTableDeletedAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> PerformTasksAfterCustomObjectTableDeletedAsync(string, RequestOptions)

A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer

```csharp theme={null}
Task PerformTasksAfterCustomObjectTableDeletedAsync(string tableName, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of DB table of the custom object that was deleted. E.g., 'y\_car'

`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\_IDiagnosticsAgent\_PerformTasksAfterUpgradeAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> PerformTasksAfterUpgradeAsync(RequestOptions)

After upgrading to a new fileset, there may be tasks that need to be done. Examples - import new TypicalSearches, if present. Tasks performed here need to be idempotent and independent of the actual upgrade jump (what was the previous version). They should complete in a reasonable time, not more than a few minutes maximum.

```csharp theme={null}
Task<string> PerformTasksAfterUpgradeAsync(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-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

Message that can be shown to the user, summarizing what has been done, if anything.

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_RegisterClosedTicketsUsageAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegisterClosedTicketsUsageAsync(int\[], RequestOptions)

Logs and registers resolved ticket count to the metering service

```csharp theme={null}
Task RegisterClosedTicketsUsageAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

IDs of closed tickets

`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\_IDiagnosticsAgent\_RemoveExpiredSystemMessagesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveExpiredSystemMessagesAsync(RequestOptions)

Deletes expired system messages.

```csharp theme={null}
Task RemoveExpiredSystemMessagesAsync(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)

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

Removes a system message for current associate

```csharp theme={null}
Task RemoveSystemMessageAsync(int onlineappId, string systemMessageId, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of the online app that owns this message

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

Message identifier, used for message  removal

`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)

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

Removes a system message for specific associate.

```csharp theme={null}
Task RemoveSystemMessageForAssociateAsync(int onlineappId, string systemMessageId, int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of the online app that owns this message

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

Message identifier, used for message update or removal

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

The associateId of the message target.

`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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_ResyncUsersAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResyncUsersAsync(RequestOptions)

Resynchronize user information with SuperOffice Community, if opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.

```csharp theme={null}
Task ResyncUsersAsync(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\_IDiagnosticsAgent\_SendSystemMessageAsync\_System\_String\_System\_Int32\_System\_String\_System\_DateTime\_SuperOffice\_WebApi\_Data\_SystemMessageType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendSystemMessageAsync(string, int, string, DateTime, SystemMessageType, RequestOptions)

Adds a system message for a specific associate.

```csharp theme={null}
Task SendSystemMessageAsync(string systemMessageId, int associateId, string markdownMessage, DateTime expire, SystemMessageType type, RequestOptions requestOptions = null)
```

#### Parameters

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

The message string id

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

The associateId of the message target.

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

Markdown message to be displayed to the user

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

When the message will no longer be available

`type` [SystemMessageType](SuperOffice.WebApi.Data.SystemMessageType.md)

Type of message, example: info, warning, error

`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)

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_TrackEventAsync\_System\_String\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TrackEventAsync(string, StringDictionary, RequestOptions)

Sends events to Amplitude and Userflow.

```csharp theme={null}
Task<long> TrackEventAsync(string trackEventName, StringDictionary eventProperties, RequestOptions requestOptions = null)
```

#### Parameters

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

"Sale Completed" or "Sale Sold" etc. See the TrackEventNames class for suitable string constants.

`eventProperties` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

key-value pairs of event properties. client is set from the application token. Special keys: app\_version, platform, os\_name, os\_version, device\_brand, device\_manufacturer

`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)\<[long](https://learn.microsoft.com/dotnet/api/system.int64)\&gt;

Amplitude Session id used to track the event. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_TrackUserAsync\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TrackUserAsync(StringDictionary, RequestOptions)

Sends user identification to Amplitude and Userflow. Sets current rights, user licenses automatically. Additional properties can be specified in userProperties.

```csharp theme={null}
Task<long> TrackUserAsync(StringDictionary userProperties, RequestOptions requestOptions = null)
```

#### Parameters

`userProperties` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

Optional: Additional key-value pairs of user properties to set on the user. Special keys: app\_version, platform, os\_name, os\_version, device\_brand, device\_manufacturer

`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)\<[long](https://learn.microsoft.com/dotnet/api/system.int64)\&gt;

Amplitude Session id used to track the user. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.

### \<a id="SuperOffice\_WebApi\_Agents\_IDiagnosticsAgent\_WebAppUsageExistsInPeriodAsync\_System\_Int32\_System\_String\_System\_DateTime\_SuperOffice\_WebApi\_RequestOptions\_">\</a> WebAppUsageExistsInPeriodAsync(int, string, DateTime, RequestOptions)

Returns true if viewState has been clicked at least once since FromDate, if asscoiateId \< 0 or FromDate is DateTime.MinValue no restriction given for those parameters

```csharp theme={null}
Task<bool> WebAppUsageExistsInPeriodAsync(int associateId, string viewState, DateTime fromDate, RequestOptions requestOptions = null)
```

#### Parameters

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

The asscoiate id to look for webapp usage

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

The viewState to search for

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

The datetime to restrict webapp usage on

`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)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if viewState has been clicked at least once since FromDate


## Related topics

- [SuperOffice.WebApi.Agents.DiagnosticsAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.DiagnosticsAgent.md)
- [Get Cache Invalidation Generations](/en/api/reference/restful/agent/diagnostics_agent/get-cache-invalidation-generations.md)
