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

# \<a id="SuperOffice\_WebApi\_Agents\_DiagnosticsAgent">\</a> Class DiagnosticsAgent

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

Diagnostics, usage data collection, caches and flushing

```csharp theme={null}
public class DiagnosticsAgent : AgentBase, IDiagnosticsAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[DiagnosticsAgent](SuperOffice.WebApi.Agents.DiagnosticsAgent.md)

#### Implements

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

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](http://example.com/super/api)");
mySession.Authorization = new AuthorizationUsernamePassword("user", "pass");
using (DiagnosticsAgent agent = new DiagnosticsAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

### \<a id="SuperOffice\_WebApi\_Agents\_DiagnosticsAgent\_\_ctor\_System\_Net\_Http\_HttpClient\_">\</a> DiagnosticsAgent(HttpClient)

Constructor: Diagnostics, usage data collection, caches and flushing

```csharp theme={null}
public DiagnosticsAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Use this HTTP client instead of making own HttpClient instance.

### \<a id="SuperOffice\_WebApi\_Agents\_DiagnosticsAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> DiagnosticsAgent(WebApiOptions, HttpClient)

Constructor: Diagnostics, usage data collection, caches and flushing

```csharp theme={null}
public DiagnosticsAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Optional: Use this HTTP client instead of making a new one.

## Methods

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

Adds WebApp usage to existing log

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

Flushes all NetServer caches

```csharp theme={null}
public 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\_DiagnosticsAgent\_FlushCachesByNameAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FlushCachesByNameAsync(string\[], RequestOptions)

Flushes all NetServer caches named

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetAnalyticsDataAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAnalyticsDataAsync(RequestOptions)

Retrieve analytics properties to be included in usage tracking.

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetCacheInvalidationGenerationsAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCacheInvalidationGenerationsAsync(string\[], RequestOptions)

Get generation for provided names

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetCacheNamesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCacheNamesAsync(RequestOptions)

Get the name of the caches that can be flushed

```csharp theme={null}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_GetEntityCountsForAllUsersAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEntityCountsForAllUsersAsync(RequestOptions)

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

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetEntityCountsForCurrentUserAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEntityCountsForCurrentUserAsync(RequestOptions)

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

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetNextTableNumberAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNextTableNumberAsync(RequestOptions)

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

```csharp theme={null}
public 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\_DiagnosticsAgent\_GetSystemMessagesAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSystemMessagesAsync(int, RequestOptions)

Retrieves a list of system messages for a specific associate.

```csharp theme={null}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_RegisterClosedTicketsUsageAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegisterClosedTicketsUsageAsync(int\[], RequestOptions)

Logs and registers resolved ticket count to the metering service

```csharp theme={null}
public 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\_DiagnosticsAgent\_RemoveExpiredSystemMessagesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveExpiredSystemMessagesAsync(RequestOptions)

Deletes expired system messages.

```csharp theme={null}
public 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\_DiagnosticsAgent\_RemoveSystemMessageAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveSystemMessageAsync(int, string, RequestOptions)

Removes a system message for current associate

```csharp theme={null}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_TrackEventAsync\_System\_String\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TrackEventAsync(string, StringDictionary, RequestOptions)

Sends events to Amplitude and Userflow.

```csharp theme={null}
public 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\_DiagnosticsAgent\_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}
public 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\_DiagnosticsAgent\_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}
public 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.Data.Installation](/en/api/reference/webapi/SuperOffice.WebApi.Data.Installation.md)
- [SuperOffice.WebApi.Data.Cache](/en/api/reference/webapi/SuperOffice.WebApi.Data.Cache.md)
- [SuperOffice.WebApi.Data.Logging](/en/api/reference/webapi/SuperOffice.WebApi.Data.Logging.md)
- [SuperOffice.WebApi.Data.WebAppUsage](/en/api/reference/webapi/SuperOffice.WebApi.Data.WebAppUsage.md)
- [SuperOffice.WebApi.Data.EntityCounts](/en/api/reference/webapi/SuperOffice.WebApi.Data.EntityCounts.md)
- [SuperOffice.WebApi.Data.UsageStats](/en/api/reference/webapi/SuperOffice.WebApi.Data.UsageStats.md)
