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

# \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent">\</a> Class PreferenceAgent

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

Preferences, user interface tab configuration

```csharp theme={null}
public class PreferenceAgent : AgentBase, IPreferenceAgent, IAgentBase, IDisposable
```

#### Inheritance

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

#### Implements

[IPreferenceAgent](SuperOffice.WebApi.Agents.IPreferenceAgent.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 (PreferenceAgent agent = new PreferenceAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

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

Constructor: Preferences, user interface tab configuration

```csharp theme={null}
public PreferenceAgent(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\_PreferenceAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> PreferenceAgent(WebApiOptions, HttpClient)

Constructor: Preferences, user interface tab configuration

```csharp theme={null}
public PreferenceAgent(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\_PreferenceAgent\_CreateDefaultPreferenceAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultPreferenceAsync(RequestOptions)

Set default values into a new Preference.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

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

A blank Preference

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_CreateDefaultPreferenceDescriptionAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultPreferenceDescriptionAsync(RequestOptions)

Set default values into a new PreferenceDescription.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

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

A blank PreferenceDescription

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_CreateDefaultPreferenceDescriptionLineAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultPreferenceDescriptionLineAsync(RequestOptions)

Set default values into a new PreferenceDescriptionLine.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

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

A blank PreferenceDescriptionLine

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_DeleteFromSectionAndKeyAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteFromSectionAndKeyAsync(string, string, RequestOptions)

Gets a PreferenceDescription based on the section and key

```csharp theme={null}
public Task DeleteFromSectionAndKeyAsync(string section, string key, RequestOptions requestOptions = null)
```

#### Parameters

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

The PreferenceDescription-section

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

The PreferenceDescription-key

`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\_PreferenceAgent\_DeletePrefDescLinesByPrefDescIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePrefDescLinesByPrefDescIdAsync(int, RequestOptions)

Delete the PrefDescLines associated with Preference Description Id in the SuperOffice database

```csharp theme={null}
public Task DeletePrefDescLinesByPrefDescIdAsync(int prefDescId, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary key of the Preference Description that contains PrefDescLines to delete

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

Nothing

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

Delete the PrefDescLines associated with Preference Description Ids in the SuperOffice database

```csharp theme={null}
public Task DeletePrefDescLinesByPrefDescIdsAsync(int[] prefDescIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary keys of the Preference Descriptions that contains PrefDescLines to delete

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

Nothing

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_DeletePreferenceAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePreferenceAsync(int, RequestOptions)

Delete a preference by id

```csharp theme={null}
public Task DeletePreferenceAsync(int id, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the preference to delete

`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\_PreferenceAgent\_DeletePreferenceDescriptionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePreferenceDescriptionAsync(int, RequestOptions)

Deletes the PreferenceDescription

```csharp theme={null}
public Task DeletePreferenceDescriptionAsync(int preferenceDescriptionId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of the PreferenceDescription

`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\_PreferenceAgent\_DeletePreferenceDescriptionLineAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePreferenceDescriptionLineAsync(int, RequestOptions)

Deletes the PreferenceDescriptionLine

```csharp theme={null}
public Task DeletePreferenceDescriptionLineAsync(int preferenceDescriptionLineId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of the PreferenceDescriptionLine

`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\_PreferenceAgent\_DeletePreferenceDescriptionLinesAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePreferenceDescriptionLinesAsync(int\[], RequestOptions)

Delete the PrefDescLines in the SuperOffice database

```csharp theme={null}
public Task DeletePreferenceDescriptionLinesAsync(int[] prefDescLineIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary keys of the PrefDescLines to delete

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

Nothing

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

Delete some preferences by id

```csharp theme={null}
public Task DeletePreferencesAsync(int[] ids, RequestOptions requestOptions = null)
```

#### Parameters

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

The ids of the preference to delete

`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\_PreferenceAgent\_GetAllAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllAsync(RequestOptions)

Gets a list of all PreferenceDescriptions in the system.

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

All PreferenceDescriptions in the system

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetAllFromSectionAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllFromSectionAsync(string, RequestOptions)

Gets all PreferenceDescription-items in the specified section

```csharp theme={null}
public Task<PreferenceDescription[]> GetAllFromSectionAsync(string section, RequestOptions requestOptions = null)
```

#### Parameters

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

The PreferenceDescription-section

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

All PreferenceDescriptions found.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetFromSectionAndKeyAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFromSectionAndKeyAsync(string, string, RequestOptions)

Gets a PreferenceDescription based on the section and key

```csharp theme={null}
public Task<PreferenceDescription> GetFromSectionAndKeyAsync(string section, string key, RequestOptions requestOptions = null)
```

#### Parameters

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

The PreferenceDescription-section

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

The PreferenceDescription-key

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

A PreferenceDescription or null

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetNetServicesStatusUrlAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNetServicesStatusUrlAsync(RequestOptions)

Returns URL to status service. e.g. '[https://help.superoffice.com/sodispatcher/v1/status](https://help.superoffice.com/sodispatcher/v1/status)' Returns NULL if status does not need to be checked yet.

```csharp theme={null}
public Task<string> GetNetServicesStatusUrlAsync(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;

NULL or URL of the status service that returns an XML or JSON block.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceAsync(int, RequestOptions)

Get a preference by id

```csharp theme={null}
public Task<Preference> GetPreferenceAsync(int id, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the preference to load

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

The preference loaded

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceByNameAndIdAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_Data\_PreferenceLevel\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceByNameAndIdAsync(string, string, PreferenceLevel, int, RequestOptions)

Get a preference by name and owner id.

```csharp theme={null}
public Task<Preference> GetPreferenceByNameAndIdAsync(string prefSection, string prefKey, PreferenceLevel prefLevel, int ownerId, RequestOptions requestOptions = null)
```

#### Parameters

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

The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.

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

The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.

`prefLevel` [PreferenceLevel](SuperOffice.WebApi.Data.PreferenceLevel.md)

The preference level to read. Undefined (0) means to return the preference defined closest to the user.

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

The preference owner id, individual or group.

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

The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceByNameAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_Data\_PreferenceLevel\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceByNameAsync(string, string, PreferenceLevel, RequestOptions)

Get a preference by name

```csharp theme={null}
public Task<Preference> GetPreferenceByNameAsync(string prefSection, string prefKey, PreferenceLevel prefLevel, RequestOptions requestOptions = null)
```

#### Parameters

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

The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.

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

The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.

`prefLevel` [PreferenceLevel](SuperOffice.WebApi.Data.PreferenceLevel.md)

The preference level to read. Undefined (0) means to return the preference defined closest to the user.

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

The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceDescriptionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceDescriptionAsync(int, RequestOptions)

Gets a specific PreferenceDescription object.

```csharp theme={null}
public Task<PreferenceDescription> GetPreferenceDescriptionAsync(int preferenceDescriptionId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the PreferenceDescription object

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

PreferenceDescription

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceDescriptionLineAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceDescriptionLineAsync(int, RequestOptions)

Gets a specific PreferenceDescriptionLine object.

```csharp theme={null}
public Task<PreferenceDescriptionLine> GetPreferenceDescriptionLineAsync(int preferenceDescriptionLineId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the PreferenceDescriptionLine object

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

PreferenceDescriptionLine

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

Get a preference description line from a prefDesc\_id and a prefValue

```csharp theme={null}
public Task<PreferenceDescriptionLine> GetPreferenceDescriptionLineFromIdAndValueAsync(int prefDescId, string prefValue, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the preference description this line is connected to

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

The value of the description line to return

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

The preference description line matching the id and the value

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferenceDescriptionLinesByPrefDescIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferenceDescriptionLinesByPrefDescIdAsync(int, RequestOptions)

Get all preference description lines from a prefDesc\_id

```csharp theme={null}
public Task<PreferenceDescriptionLine[]> GetPreferenceDescriptionLinesByPrefDescIdAsync(int prefDescId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the preference description this line is connected to

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

The preference description lines matching the id

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferencesAsync\_SuperOffice\_WebApi\_Data\_PreferenceSpec\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferencesAsync(PreferenceSpec\[], RequestOptions)

Get one or more preferences based on a set of specifications.\<br/>The prefDisplayvalue and prefDisplaytooltip are blank (faster processing relative to GetPreferencesWithDisplayValues)

```csharp theme={null}
public Task<Preference[]> GetPreferencesAsync(PreferenceSpec[] specifications, RequestOptions requestOptions = null)
```

#### Parameters

`specifications` [PreferenceSpec](SuperOffice.WebApi.Data.PreferenceSpec.md)\[]

Array of preference specifications. The key value may be \* (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!

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

Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetPreferencesWithDisplayValuesAsync\_SuperOffice\_WebApi\_Data\_PreferenceSpec\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreferencesWithDisplayValuesAsync(PreferenceSpec\[], RequestOptions)

Get one or more preferences based on a set of specifications\<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.

```csharp theme={null}
public Task<Preference[]> GetPreferencesWithDisplayValuesAsync(PreferenceSpec[] specifications, RequestOptions requestOptions = null)
```

#### Parameters

`specifications` [PreferenceSpec](SuperOffice.WebApi.Data.PreferenceSpec.md)\[]

Array of preference specifications. The key value may be \* (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!

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

Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.\<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetTabOrderAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTabOrderAsync(string, RequestOptions)

Gets the tab order.

```csharp theme={null}
public Task<TabOrder> GetTabOrderAsync(string tabName, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of the tab control

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

Tab order. Array of strings. Each string represent a named tab.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetTabOrdersAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTabOrdersAsync(RequestOptions)

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

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetXsrfPathsAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetXsrfPathsAsync(string, RequestOptions)

Returns paths that XSRF cookies should be set on

```csharp theme={null}
public Task<string[]> GetXsrfPathsAsync(string hostname, RequestOptions requestOptions = null)
```

#### Parameters

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

The hostname that we are storing paths 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)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

Paths that XSRF cookies should be set for: \['/cs', '/crm']

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_GetXsrfValueAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetXsrfValueAsync(RequestOptions)

Returns the XSRF token value and last update time for the current user

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

The XSRF token value and timestamp

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SaveFromSectionAndKeyAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_Data\_PreferenceDescription\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveFromSectionAndKeyAsync(string, string, PreferenceDescription, RequestOptions)

Update a PreferenceDescription based on the section and key

```csharp theme={null}
public Task<PreferenceDescription> SaveFromSectionAndKeyAsync(string section, string key, PreferenceDescription preferenceDescription, RequestOptions requestOptions = null)
```

#### Parameters

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

The PreferenceDescription-section

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

The PreferenceDescription-key

`preferenceDescription` [PreferenceDescription](SuperOffice.WebApi.Data.PreferenceDescription.md)

The PreferenceDescription to save.

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

Saved PreferenceDescription

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SavePreferenceAsync\_SuperOffice\_WebApi\_Data\_Preference\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceAsync(Preference, RequestOptions)

Save this preference

```csharp theme={null}
public Task SavePreferenceAsync(Preference preference, RequestOptions requestOptions = null)
```

#### Parameters

`preference` [Preference](SuperOffice.WebApi.Data.Preference.md)

Preference to be saved. All fields must be filled in, and the preference will be saved on the Associate level only. Setting for other levels is an administrative task and not available through this service.

`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\_PreferenceAgent\_SavePreferenceDescriptionAsync\_SuperOffice\_WebApi\_Data\_PreferenceDescription\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceDescriptionAsync(PreferenceDescription, RequestOptions)

Updates the existing PreferenceDescription or creates a new PreferenceDescription if the id parameter is 0.

```csharp theme={null}
public Task<PreferenceDescription> SavePreferenceDescriptionAsync(PreferenceDescription preferenceDescription, RequestOptions requestOptions = null)
```

#### Parameters

`preferenceDescription` [PreferenceDescription](SuperOffice.WebApi.Data.PreferenceDescription.md)

The PreferenceDescription that is saved.

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

New or updated PreferenceDescription

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SavePreferenceDescriptionLineAsync\_SuperOffice\_WebApi\_Data\_PreferenceDescriptionLine\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceDescriptionLineAsync(PreferenceDescriptionLine, RequestOptions)

Updates the existing PreferenceDescriptionLine or creates a new PreferenceDescriptionLine if the id parameter is 0.

```csharp theme={null}
public Task<PreferenceDescriptionLine> SavePreferenceDescriptionLineAsync(PreferenceDescriptionLine preferenceDescriptionLine, RequestOptions requestOptions = null)
```

#### Parameters

`preferenceDescriptionLine` [PreferenceDescriptionLine](SuperOffice.WebApi.Data.PreferenceDescriptionLine.md)

The PreferenceDescriptionLine that is saved.

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

New or updated PreferenceDescriptionLine

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SavePreferenceDescriptionLinesAsync\_SuperOffice\_WebApi\_Data\_PreferenceDescriptionLine\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceDescriptionLinesAsync(PreferenceDescriptionLine\[], RequestOptions)

Saves the PreferenceDescriptionLine array in the SuperOffice database

```csharp theme={null}
public Task<PreferenceDescriptionLine[]> SavePreferenceDescriptionLinesAsync(PreferenceDescriptionLine[] preferenceDescriptionLines, RequestOptions requestOptions = null)
```

#### Parameters

`preferenceDescriptionLines` [PreferenceDescriptionLine](SuperOffice.WebApi.Data.PreferenceDescriptionLine.md)\[]

The PreferenceDescriptionLine array to save.

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

The updated PrefDesc lines (If the PreferenceDescriptionLine array was new, it returns with id's set.

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SavePreferenceEntitiesAsync\_SuperOffice\_WebApi\_Data\_Preference\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceEntitiesAsync(Preference\[], bool, RequestOptions)

Save this set of preferences.

```csharp theme={null}
public Task SavePreferenceEntitiesAsync(Preference[] preferences, bool removeLowerLevels, RequestOptions requestOptions = null)
```

#### Parameters

`preferences` [Preference](SuperOffice.WebApi.Data.Preference.md)\[]

Preferences to be saved. Note that all fields must be filled in.

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

If this is true, all user preferences on lower levels will be deleted

`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\_PreferenceAgent\_SavePreferenceEntityAsync\_SuperOffice\_WebApi\_Data\_Preference\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceEntityAsync(Preference, bool, RequestOptions)

Saves a complete preference object, on any level and any target. Preference administrator rights are required to use this

```csharp theme={null}
public Task<Preference> SavePreferenceEntityAsync(Preference preference, bool removeLowerLevels, RequestOptions requestOptions = null)
```

#### Parameters

`preference` [Preference](SuperOffice.WebApi.Data.Preference.md)

The preference object to be saved

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

If this is true, all user preferences on lower levels will be deleted

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

Returns the saved preference

### \<a id="SuperOffice\_WebApi\_Agents\_PreferenceAgent\_SavePreferencesAsync\_SuperOffice\_WebApi\_Data\_Preference\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferencesAsync(Preference\[], RequestOptions)

Save this set of preferences. Note this method DOES NOT look at level/targetId - it only saves on behalf of the CURRENT USER.

```csharp theme={null}
public Task SavePreferencesAsync(Preference[] preferences, RequestOptions requestOptions = null)
```

#### Parameters

`preferences` [Preference](SuperOffice.WebApi.Data.Preference.md)\[]

Preferences to be saved. Note that all fields must be filled in, and the preference will be saved on the Associate level only! Setting for other levels is an administrative task and not available through this service.

`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\_PreferenceAgent\_SaveTabOrderAsync\_SuperOffice\_WebApi\_Data\_TabOrder\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTabOrderAsync(TabOrder, RequestOptions)

Saves the tab order. The order is saved pr. user.

```csharp theme={null}
public Task SaveTabOrderAsync(TabOrder tabOrder, RequestOptions requestOptions = null)
```

#### Parameters

`tabOrder` [TabOrder](SuperOffice.WebApi.Data.TabOrder.md)

Name of the tab control

`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\_PreferenceAgent\_SaveTabOrdersAsync\_SuperOffice\_WebApi\_Data\_TabOrder\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTabOrdersAsync(TabOrder\[], RequestOptions)

```csharp theme={null}
public Task SaveTabOrdersAsync(TabOrder[] tabOrders, RequestOptions requestOptions = null)
```

#### Parameters

`tabOrders` [TabOrder](SuperOffice.WebApi.Data.TabOrder.md)\[]

`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\_PreferenceAgent\_SetXsrfPathsAsync\_System\_String\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetXsrfPathsAsync(string, string\[], RequestOptions)

Update the paths that need XSRF cookies

```csharp theme={null}
public Task SetXsrfPathsAsync(string hostname, string[] paths, RequestOptions requestOptions = null)
```

#### Parameters

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

The hostname that we are storing paths for.

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

Paths that XSRF cookies should be set for: \['/cs', '/crm']

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

Sets the XSRF token value for the current user

```csharp theme={null}
public Task SetXsrfValueAsync(string xsrfValue, RequestOptions requestOptions = null)
```

#### Parameters

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

The XSRF value to store

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

Update the NetServices preferences with values contained in the content from the Status URL

```csharp theme={null}
public Task UpdateNetServicesStatusAsync(string xml_or_json, RequestOptions requestOptions = null)
```

#### Parameters

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

The text that was returned by getting the Status URL

`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
