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

# \<a id="SuperOffice\_WebApi\_Agents\_IPreferenceAgent">\</a> Interface IPreferenceAgent

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

Preferences, user interface tab configuration

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

#### Implements

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

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_DeletePreferenceAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeletePreferenceAsync(int, RequestOptions)

Delete a preference by id

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

Deletes the PreferenceDescription

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

Deletes the PreferenceDescriptionLine

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

Delete the PrefDescLines in the SuperOffice database

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

Delete some preferences by id

```csharp theme={null}
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\_IPreferenceAgent\_GetAllAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllAsync(RequestOptions)

Gets a list of all PreferenceDescriptions in the system.

```csharp theme={null}
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\_IPreferenceAgent\_GetAllFromSectionAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllFromSectionAsync(string, RequestOptions)

Gets all PreferenceDescription-items in the specified section

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

Get a preference by id

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

Gets a specific PreferenceDescription object.

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

Gets a specific PreferenceDescriptionLine object.

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

Get all preference description lines from a prefDesc\_id

```csharp theme={null}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_GetTabOrderAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTabOrderAsync(string, RequestOptions)

Gets the tab order.

```csharp theme={null}
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\_IPreferenceAgent\_GetTabOrdersAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTabOrdersAsync(RequestOptions)

```csharp theme={null}
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\_IPreferenceAgent\_GetXsrfPathsAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetXsrfPathsAsync(string, RequestOptions)

Returns paths that XSRF cookies should be set on

```csharp theme={null}
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\_IPreferenceAgent\_GetXsrfValueAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetXsrfValueAsync(RequestOptions)

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

```csharp theme={null}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_SavePreferenceAsync\_SuperOffice\_WebApi\_Data\_Preference\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceAsync(Preference, RequestOptions)

Save this preference

```csharp theme={null}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_SavePreferenceDescriptionLinesAsync\_SuperOffice\_WebApi\_Data\_PreferenceDescriptionLine\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceDescriptionLinesAsync(PreferenceDescriptionLine\[], RequestOptions)

Saves the PreferenceDescriptionLine array in the SuperOffice database

```csharp theme={null}
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\_IPreferenceAgent\_SavePreferenceEntitiesAsync\_SuperOffice\_WebApi\_Data\_Preference\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SavePreferenceEntitiesAsync(Preference\[], bool, RequestOptions)

Save this set of preferences.

```csharp theme={null}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_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}
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\_IPreferenceAgent\_SaveTabOrdersAsync\_SuperOffice\_WebApi\_Data\_TabOrder\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTabOrdersAsync(TabOrder\[], RequestOptions)

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

Update the paths that need XSRF cookies

```csharp theme={null}
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\_IPreferenceAgent\_SetXsrfValueAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetXsrfValueAsync(string, RequestOptions)

Sets the XSRF token value for the current user

```csharp theme={null}
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\_IPreferenceAgent\_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}
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


## Related topics

- [SuperOffice.WebApi.Agents.PreferenceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PreferenceAgent.md)
- [Get Preferences](/en/api/reference/restful/agent/preference_agent/get-preferences.md)
- [Save Preferences](/en/api/reference/restful/agent/preference_agent/save-preferences.md)
