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

# \<a id="SuperOffice\_WebApi\_Agents\_UserAgent">\</a> Class UserAgent

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

User administration
\<p>\</p>
\<b>Online Restricted:\</b> This agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public class UserAgent : AgentBase, IUserAgent, IAgentBase, IDisposable
```

#### Inheritance

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

#### Implements

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

## Constructors

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

Constructor: User administration

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

Constructor: User administration

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

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task AddOwnerContactAsync(int contactId, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of the contact to add as a owner contact

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

Check if the current assoicate can change the password for an associate
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> CanChangePasswordAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of the user to check if password can be changed

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

True if the associate can change the password

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ChangeOwnPasswordAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeOwnPasswordAsync(string, string, RequestOptions)

Change password for a user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> ChangeOwnPasswordAsync(string oldPassword, string newPassword, RequestOptions requestOptions = null)
```

#### Parameters

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

The current password of the user.  Administrators can leave this blank to force a new password upon a user.

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

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

True if the password was successfully changed.

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

Change password for a user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> ChangePasswordAsync(int associateId, string oldPassword, string newPassword, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of the user to change password for.

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

The current password of the user.  Administrators can leave this blank to force a new password upon a user.

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

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

True if the password was successfully changed.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ChangePasswordFromNameAsync\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangePasswordFromNameAsync(string, string, string, RequestOptions)

Change password for a user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> ChangePasswordFromNameAsync(string associateName, string oldPassword, string newPassword, RequestOptions requestOptions = null)
```

#### Parameters

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

Username of the user to change password for.

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

The current password of the user.  Administrators can leave this blank to force a new password upon a user.

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

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

True if the password was successfully changed.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ChangeUserTypeAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_Data\_UserType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeUserTypeAsync(User, UserType, RequestOptions)

Get a user from the user name.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> ChangeUserTypeAsync(User user, UserType userType, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.md)

User name of the user to get.

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

User retrieved by name

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CheckAccessGatewayRegistrationAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CheckAccessGatewayRegistrationAsync(RequestOptions)

Checks if AccessGatewayRegistration is valid
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

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

True if the registration is usable

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultRoleEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultRoleEntityAsync(RequestOptions)

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

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

A blank RoleEntity

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultRoleEntityFromTypeAsync\_SuperOffice\_WebApi\_Data\_RoleType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultRoleEntityFromTypeAsync(RoleType, RequestOptions)

Create a new role entity of the specified role type. The role type cannot be changed after the entity is created.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<RoleEntity> CreateDefaultRoleEntityFromTypeAsync(RoleType type, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of role (Employee/External/Anonymous/System)

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

A blank role.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultServiceAuthAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultServiceAuthAsync(RequestOptions)

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

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

A blank ServiceAuth

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultUntrustedCredentialsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultUntrustedCredentialsAsync(RequestOptions)

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

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

A blank UntrustedCredentials

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultUserAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultUserAsync(RequestOptions)

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

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

A blank User

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultUserFromUserTypeAndCredentialAsync\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultUserFromUserTypeAndCredentialAsync(UserType, int, string, string, string, RequestOptions)

Creates a PersonEntity with default values based on the contactId and credentials.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> CreateDefaultUserFromUserTypeAndCredentialAsync(UserType userType, int contactId, string credentialType, string credentialValue, string credentialDisplayValue, RequestOptions requestOptions = null)
```

#### Parameters

`userType` [UserType](SuperOffice.WebApi.Data.UserType.md)

Type of associate for the user

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

Contact id of the person

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

Type of credentials, corresponding to name of plugin and type in the credentials table.

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

This is the actuall value of the credentials.  This will typically be the password or teh users SID in active directory

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

The value displayed to the user. this will typically be the users login name in active directory.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultUserFromUserTypeAndPersonIdAsync\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultUserFromUserTypeAndPersonIdAsync(UserType, int, RequestOptions)

Create default User providing the associate type and person id.  System and Anonymous users can be created without an exsisting person and permits person id to be 0.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> CreateDefaultUserFromUserTypeAndPersonIdAsync(UserType userType, int personId, RequestOptions requestOptions = null)
```

#### Parameters

`userType` [UserType](SuperOffice.WebApi.Data.UserType.md)

Type of associate for the user

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

Primary key of the person to become a 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)\<[User](SuperOffice.WebApi.Data.User.md)\&gt;

New user object with defalt values set.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateDefaultUserFromUserTypeAsync\_SuperOffice\_WebApi\_Data\_UserType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultUserFromUserTypeAsync(UserType, RequestOptions)

Create default User providing the user type.  Only System and Anonymous users can be created without an exsisting person.  Use CreateDefaultUserFromUserTypeAndPersonId to create internal (i.e. Employee) or external users.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> CreateDefaultUserFromUserTypeAsync(UserType userType, RequestOptions requestOptions = null)
```

#### Parameters

`userType` [UserType](SuperOffice.WebApi.Data.UserType.md)

Type of associate for the user.  This can only be System or Anonymous. Use CreateDefaultUserFromUserTypeAndPersonId to create internal (i.e. Employee) or external users.

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

New user object with defalt values set.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateExternalUserAsync\_System\_Int32\_System\_String\_System\_String\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateExternalUserAsync(int, string, string, int, bool, RequestOptions)

Creates an associate of type external user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<int> CreateExternalUserAsync(int personId, string userName, string password, int roleId, bool isActive, RequestOptions requestOptions = null)
```

#### Parameters

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

The personId to create an external user for.

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

Login username.

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

Login password.

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

Id of role for the external user. The role must be a role of type external users.

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

Set isActive to true to enable the external user to log in.

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

Returns the created associateId.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_CreateUserGroupAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateUserGroupAsync(RequestOptions)

Create UserGroup (Rank is assigned to the highest rank)
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_DecryptAndSaveExternalTokensAsync\_SuperOffice\_WebApi\_Data\_TokenManagementInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DecryptAndSaveExternalTokensAsync(TokenManagementInfo, RequestOptions)

First asks AccessGateway to decrypt the tokens, then saves the external tokens to the DB and returns a key that can be used to retrieve them
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> DecryptAndSaveExternalTokensAsync(TokenManagementInfo tokenManagementInfo, RequestOptions requestOptions = null)
```

#### Parameters

`tokenManagementInfo` [TokenManagementInfo](SuperOffice.WebApi.Data.TokenManagementInfo.md)

Token information.

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

Key that can be used to retrieve the tokens

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

Remove credential of a specific type for a user
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> DeleteCredentialAsync(int userId, string credentialType, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary key of the user (i.e. associate)

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

Type of credentials, corresponding to name of plugin and type in the credentials table

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

True if credential was sucessfully removed.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_DeleteExternalUserAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteExternalUserAsync(int, RequestOptions)

Deletes an associate of type external user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteExternalUserAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

The associateId to delete the associate entry 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)

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_DeleteRoleAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteRoleAsync(int, int, RequestOptions)

Delete the specified role and move all users associated with the role to the replacingRoleId
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteRoleAsync(int roleIdToDelete, int replacingRoleId, RequestOptions requestOptions = null)
```

#### Parameters

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

The roleId to delete

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

The roleId which all associated users will be moved 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)

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_DeleteServiceAuthAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteServiceAuthAsync(int, RequestOptions)

Deletes the ServiceAuth
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteServiceAuthAsync(int serviceAuthId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of the ServiceAuth

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

Deletes the User
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteUserAsync(int userId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of 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)

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_DeleteUserFromNameAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteUserFromNameAsync(string, RequestOptions)

Delete a user, with lookup based on the user name.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteUserFromNameAsync(string userName, RequestOptions requestOptions = null)
```

#### Parameters

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

User name of the user 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\_UserAgent\_DeleteUserGroupAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteUserGroupAsync(int, int, RequestOptions)

Delete a usergroup and move its members to another usergroup
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task DeleteUserGroupAsync(int userGroupToDelete, int userGroupToMoveTo, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the userGroup to delete

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

The id of the userGroup to move the members 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)

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ExchangeCodeAndSaveTokensAsync\_System\_String\_System\_String\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExchangeCodeAndSaveTokensAsync(string, string, string, string, string, RequestOptions)

Exchanges an authorization code for tokens.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> ExchangeCodeAndSaveTokensAsync(string provider, string authorizationCode, string nonce, string pkceVerifier, string redirectUri, RequestOptions requestOptions = null)
```

#### Parameters

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

The provider of the underlying data.

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

The authorization code to exchange for a token.

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

The nonce to verify against the id\_token's nonce if present.

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

The cryptographic proof for the client to verify.

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

We need to be able to dynamically inject the redirect based on location(app.superoffice.com vs online2.superoffice.com)

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

Reference to the key for the tokens in the database, and extracted claims.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ExecuteUserCommandAsync\_System\_String\_SuperOffice\_WebApi\_Data\_CommandActionResult\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteUserCommandAsync(string, CommandActionResult, User, RequestOptions)

Executes the custom command for User
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CommandResult> ExecuteUserCommandAsync(string commandName, CommandActionResult actionResult, User user, RequestOptions requestOptions = null)
```

#### Parameters

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

The name of the command to execute.

`actionResult` [CommandActionResult](SuperOffice.WebApi.Data.CommandActionResult.md)

Result of an UI operation.

`user` [User](SuperOffice.WebApi.Data.User.md)

The User to execute commands 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)\<[CommandResult](SuperOffice.WebApi.Data.CommandResult.md)\&gt;

Result of the executed command

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_FindCredentialUsersAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindCredentialUsersAsync(string, string, RequestOptions)

Find users matching the partial name.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CredentialsGroupUsers> FindCredentialUsersAsync(string type, string searchString, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credentials, corresponding to name of plugin and type in the credentials table.

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

Partly name of the user 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)\<[CredentialsGroupUsers](SuperOffice.WebApi.Data.CredentialsGroupUsers.md)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_FindCredentialsGroupsAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindCredentialsGroupsAsync(string, string, RequestOptions)

Get user groups holding users filtered by the searchString.  This method is only relevant if the CredentialType control is of type link.  There will allways be at least one groups even if the underlying provider does not support groups.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CredentialsGroup[]> FindCredentialsGroupsAsync(string type, string searchString, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credentials, corresponding to name of plugin and type in the credentials table.

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

Partly name of domain 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)\<[CredentialsGroup](SuperOffice.WebApi.Data.CredentialsGroup.md)\[]\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_FindRolesWithFunctionalRightAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> FindRolesWithFunctionalRightAsync(string, RequestOptions)

Find all roles with a given functional right. The roles matched must contain the specified functional right.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<MDOListItem[]> FindRolesWithFunctionalRightAsync(string functionalRightName, RequestOptions requestOptions = null)
```

#### Parameters

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

Functional right name to search 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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Roles that contains the given functional right

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

Find all roles with a given set of functional rights. The roles matched must contain one or more of the specified functional rights.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<int[]> FindRolesWithFunctionalRightsAsync(string[] functionalRightNames, RequestOptions requestOptions = null)
```

#### Parameters

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

An array of functional rights names to search 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)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\[]\&gt;

Role ids that contains your functional rights

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

Find all roles without a given set of functional rights. The roles matched must not contain any of the specified functional rights.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<int[]> FindRolesWithoutFunctionalRightsAsync(string[] functionalRightNames, RequestOptions requestOptions = null)
```

#### Parameters

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

An array of functional rights names to search 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)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\[]\&gt;

Role ids that without your functional rights

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GenerateNewPasswordForExternalUserAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GenerateNewPasswordForExternalUserAsync(string, RequestOptions)

Generates a new password for an external user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GenerateNewPasswordForExternalUserAsync(string associateName, RequestOptions requestOptions = null)
```

#### Parameters

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

The name of the associate to change the password 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;

Returns the generated password.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAccessGatewayInfoAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAccessGatewayInfoAsync(RequestOptions)

Returns accessgateway registration info
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAccessTokenAsync\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAccessTokenAsync(string, bool, RequestOptions)

Get an access token based on the current user's session.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GetAccessTokenAsync(string app_token, bool includeCsSession, RequestOptions requestOptions = null)
```

#### Parameters

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

Application token to get access on behalf of. Optional.

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

Initialize CS session for this access token?.

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

An access token. "8A:xyz123=="

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAllDataRightsAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_RoleRelationToOwner\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllDataRightsAsync(int, RoleRelationToOwner, RequestOptions)

Get a list of all data rights for the given role, filtered by relation to owner. MDO List name = 'DataRights', extra='roleType=0'.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<StringDictionary> GetAllDataRightsAsync(int roleId, RoleRelationToOwner relationToOwner, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to set the functional rights for

`relationToOwner` [RoleRelationToOwner](SuperOffice.WebApi.Data.RoleRelationToOwner.md)

The id of the relation to owner

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

The CRUD rights (C, CR, CRU, or CRUD) for each table related to the given role and relation to owner.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAllFunctionalRightsAsync\_SuperOffice\_WebApi\_Data\_RoleType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllFunctionalRightsAsync(RoleType, RequestOptions)

Get a list of all functional rights for the given type of role. MDO List name = 'FunctionRights', extra='roleType=0'
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetAllFunctionalRightsAsync(RoleType roleType, RequestOptions requestOptions = null)
```

#### Parameters

`roleType` [RoleType](SuperOffice.WebApi.Data.RoleType.md)

Type of role (Employee/External/Anonymous/System)

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

FunctionRight items with name and description. Code name for function right is in the extra-info property.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAllRolesAsync\_SuperOffice\_WebApi\_Data\_RoleType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllRolesAsync(RoleType, RequestOptions)

Get a list of all roles for the given type of role. MDO List name = 'Roles', extra='0' (roleType)
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetAllRolesAsync(RoleType roleType, RequestOptions requestOptions = null)
```

#### Parameters

`roleType` [RoleType](SuperOffice.WebApi.Data.RoleType.md)

Type of role (Employee/External/Anonymous/System)

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

FunctionRight items with name and description. Code name for function right is in the extra-info property.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetAllUserGroupsAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllUserGroupsAsync(bool, RequestOptions)

Get all user groups
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserGroup[]> GetAllUserGroupsAsync(bool includeDeleted, RequestOptions requestOptions = null)
```

#### Parameters

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

Include user groups with Deleted set to true

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

All user groups

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetCredentialTypesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCredentialTypesAsync(RequestOptions)

Get available credential types that can be used for authentication
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

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

Credential types that can be used for authentication

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetCredentialTypesForUserTypeAsync\_SuperOffice\_WebApi\_Data\_UserType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCredentialTypesForUserTypeAsync(UserType, RequestOptions)

Get available credential types that can be used for the specified user type.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CredentialType[]> GetCredentialTypesForUserTypeAsync(UserType userType, RequestOptions requestOptions = null)
```

#### Parameters

`userType` [UserType](SuperOffice.WebApi.Data.UserType.md)

The user type to retrieve credential types 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)\<[CredentialType](SuperOffice.WebApi.Data.CredentialType.md)\[]\&gt;

Credential types that can be used for authentication

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetCredentialUsersInGroupAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCredentialUsersInGroupAsync(string, string, RequestOptions)

Get credential users within a user group
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CredentialsGroupUsers> GetCredentialUsersInGroupAsync(string type, string groupName, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credentials, corresponding to name of plugin and type in the credentials table.

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

Name of user group needed to discover the users.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetCurrentPrincipal\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCurrentPrincipal(RequestOptions)

Get information about the currently logged in user in the form of a SoPrincipalCarrier

```csharp theme={null}
public Task<SoPrincipalCarrier> GetCurrentPrincipal(RequestOptions requestOptions = null)
```

#### Parameters

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

#### Returns

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetCurrentToken\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCurrentToken(RequestOptions)

Get the current token for the currently logged in user

```csharp theme={null}
public Task<string> GetCurrentToken(RequestOptions requestOptions = null)
```

#### Parameters

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

#### Returns

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetDataRightAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_Data\_RoleRelationToOwner\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDataRightAsync(int, string, RoleRelationToOwner, RequestOptions)

Read one specific data right at the given position. An exception will be thrown if non existing position is specified.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GetDataRightAsync(int roleId, string tableName, RoleRelationToOwner relationToOwner, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to set the data right for

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

The name of the entity/table

`relationToOwner` [RoleRelationToOwner](SuperOffice.WebApi.Data.RoleRelationToOwner.md)

The id of the relation to owner

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

The data right value at the specified position (C, CR, CRU, or CRUD)

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

Read specific a set of data rights at the given row in the rights matrix. An exception will be thrown if non existing position is specified.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<StringDictionary> GetDataRightsAsync(int roleId, string tableName, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to set the data right for

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

The name of the entity/table

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

The data right values for all the defined relationships (C, CR, CRU, or CRUD)

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetDefaultAssociateUserNameAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDefaultAssociateUserNameAsync(User, RequestOptions)

Get the default username for a person
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GetDefaultAssociateUserNameAsync(User user, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.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-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetExternalTokensAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetExternalTokensAsync(string, RequestOptions)

Retrieve the tokens from the DB based on the given key
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<TokenManagementInfo> GetExternalTokensAsync(string key, RequestOptions requestOptions = null)
```

#### Parameters

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

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

Key to retrieve tokens

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetFunctionalRightsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFunctionalRightsAsync(int, RequestOptions)

Get all functional rights for the given role. Functional rights not set on the role are not included. MDO List name = 'FunctionRights', extra='role=123'
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetFunctionalRightsAsync(int roleId, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to get the functional rights 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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

FunctionRight items with name and description. Code name for function right is in the extra-info property.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetOrRegisterAccessGatewayInfoAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetOrRegisterAccessGatewayInfoAsync(string, RequestOptions)

Returns accessgateway registration info and registers a new or adds the url if necessary
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<AccessGatewayInfo> GetOrRegisterAccessGatewayInfoAsync(string redirectUri, RequestOptions requestOptions = null)
```

#### Parameters

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

This is the registered redirect\_uri for AccessGateway OIDC.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetRoleAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetRoleAsync(int, RequestOptions)

Gets a specific Role object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<Role> GetRoleAsync(int roleId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the Role 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)\<[Role](SuperOffice.WebApi.Data.Role.md)\&gt;

Role

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetRoleEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetRoleEntityAsync(int, RequestOptions)

Gets a specific RoleEntity object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<RoleEntity> GetRoleEntityAsync(int roleEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the RoleEntity 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)\<[RoleEntity](SuperOffice.WebApi.Data.RoleEntity.md)\&gt;

RoleEntity

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetServiceAuthAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetServiceAuthAsync(int, RequestOptions)

Gets a specific ServiceAuth object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<ServiceAuth> GetServiceAuthAsync(int serviceAuthId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the ServiceAuth 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)\<[ServiceAuth](SuperOffice.WebApi.Data.ServiceAuth.md)\&gt;

ServiceAuth

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetSupportedChangePasswordTypesAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSupportedChangePasswordTypesAsync(int, RequestOptions)

Get the different methods the user can use to change password
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<ChangePasswordType[]> GetSupportedChangePasswordTypesAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of the user to check if password can be changed

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

List of types - empty if the user cannot change password in any way

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUntrustedCredentialsAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUntrustedCredentialsAsync(string, RequestOptions)

Get a set of credentials of a specified type for authenticated user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UntrustedCredentials[]> GetUntrustedCredentialsAsync(string type, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credential(Ex: "imap", "smtp").

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

Array of credentials of the specified type.

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

Get a set of credentials of a specified type for a specified user. SecretValue is only populated for authenticated user, and system users.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UntrustedCredentials[]> GetUntrustedCredentialsForAssociateAsync(int associateId, string type, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of user to retrieve credentials for.

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

Type of credential(Ex: "imap", "smtp").

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

Array of credentials of the specified type.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserAsync(int, RequestOptions)

Gets a specific User object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> GetUserAsync(int userId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the User 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)\<[User](SuperOffice.WebApi.Data.User.md)\&gt;

User

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserCommandsAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserCommandsAsync(User, RequestOptions)

Get registered custom commands for User
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<CustomCommand[]> GetUserCommandsAsync(User user, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.md)

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

Custom commands for the User

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserFromEjUserIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserFromEjUserIdAsync(int, RequestOptions)

Get user from ejUserId - used for eJournal Legacy Support.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User[]> GetUserFromEjUserIdAsync(int ejUserId, RequestOptions requestOptions = null)
```

#### Parameters

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

ejUserId -

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserFromNameAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserFromNameAsync(string, RequestOptions)

Get a user, with lookup based on user name.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> GetUserFromNameAsync(string userName, RequestOptions requestOptions = null)
```

#### Parameters

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

User name of the user to get.

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

User retrieved by name

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserFromPersonIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserFromPersonIdAsync(int, RequestOptions)

Returns the user associated with the supplied person id
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User[]> GetUserFromPersonIdAsync(int personId, RequestOptions requestOptions = null)
```

#### Parameters

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserGroupAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserGroupAsync(int, RequestOptions)

Gets a specific UserGroup object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserGroup> GetUserGroupAsync(int userGroupId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the UserGroup 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)\<[UserGroup](SuperOffice.WebApi.Data.UserGroup.md)\&gt;

UserGroup

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

Gets an array of specific UserGroup objects.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserGroup[]> GetUserGroupListAsync(int[] userGroupIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifiers of the UserGroup 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)\<[UserGroup](SuperOffice.WebApi.Data.UserGroup.md)\[]\&gt;

Array of UserGroup objects

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserInfoAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserInfoAsync(int, RequestOptions)

Gets a specific UserInfo object.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserInfo> GetUserInfoAsync(int userInfoId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the UserInfo 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)\<[UserInfo](SuperOffice.WebApi.Data.UserInfo.md)\&gt;

UserInfo

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

Gets an array of specific UserInfo objects.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserInfo[]> GetUserInfoListAsync(int[] userInfoIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifiers of the UserInfo 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)\<[UserInfo](SuperOffice.WebApi.Data.UserInfo.md)\[]\&gt;

Array of UserInfo objects

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetUserPresenceStatusAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserPresenceStatusAsync(int, RequestOptions)

Get user presence status
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserPresenceStatus> GetUserPresenceStatusAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of user to retrieve status 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)\<[UserPresenceStatus](SuperOffice.WebApi.Data.UserPresenceStatus.md)\&gt;

User presence status

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetValidUserNameAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetValidUserNameAsync(int, UserType, int, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GetValidUserNameAsync(int associateId, UserType type, int personId, string userName, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

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

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

Override language/culture codes on this request.

#### Returns

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_GetValidUserNameForNewUserAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetValidUserNameForNewUserAsync(User, RequestOptions)

Generates a valid username for an unsaved user
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> GetValidUserNameForNewUserAsync(User user, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.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-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

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

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> IsNickNameUniqueAsync(int associateId, string nickName, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_IsPasswordValidAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> IsPasswordValidAsync(int, UserType, int, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> IsPasswordValidAsync(int associateId, UserType type, int personId, string password, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_IsPasswordValidWithReasonAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> IsPasswordValidWithReasonAsync(int, UserType, int, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserValidationResult> IsPasswordValidWithReasonAsync(int associateId, UserType type, int personId, string password, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_IsUserNameValidAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> IsUserNameValidAsync(int, UserType, int, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> IsUserNameValidAsync(int associateId, UserType type, int personId, string userName, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_IsUserNameValidWithReasonAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserType\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> IsUserNameValidWithReasonAsync(int, UserType, int, string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserValidationResult> IsUserNameValidWithReasonAsync(int associateId, UserType type, int personId, string userName, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

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

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_MakeRetiredAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MakeRetiredAsync(int, bool, RequestOptions)

Retiring a user means to remove all licenses, setting person.retired=1 and associate.deleted=1. Unretiering a user means setting  person.retired=0 and associate.deleted=0
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task MakeRetiredAsync(int associateId, bool retired, RequestOptions requestOptions = null)
```

#### Parameters

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

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

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

Registers with access gateway if not already done, otherwise will attempt to update
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<AccessGatewayInfo> RegisterWithAccessGatewayAsync(string redirectUri, RequestOptions requestOptions = null)
```

#### Parameters

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

This is the registered redirect\_uri for AccessGateway OIDC.

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_RemoveLicensesAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveLicensesAsync(int, RequestOptions)

Remove all user licenses.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task RemoveLicensesAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

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

Remove a contact from the ownercontactlink table
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task RemoveOwnerContactAsync(int contactId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the contact to remove

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

Remove a credentials entry for authenticated user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task RemoveUntrustedCredentialsAsync(string type, string publicValue, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credential(Ex: "imap", "smtp")

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

PublicValue field of credentials to remove.

`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\_UserAgent\_RemoveUntrustedCredentialsForAssociateAsync\_System\_Int32\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveUntrustedCredentialsForAssociateAsync(int, string, string, RequestOptions)

Remove a credentials entry for a specified user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task RemoveUntrustedCredentialsForAssociateAsync(int associateId, string type, string publicValue, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of user to remove credentials for.

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

Type of credential(Ex: "imap", "smtp")

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

PublicValue field of credentials to remove.

`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\_UserAgent\_ResolveUserFromInfoAsync\_System\_Int32\_System\_String\_System\_String\_\_\_System\_String\_\_\_SuperOffice\_WebApi\_Data\_UserType\_SuperOffice\_WebApi\_Data\_Credential\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResolveUserFromInfoAsync(int, string, string\[], string\[], UserType, Credential, RequestOptions)

Get a user from the provided information. If the user or associated person does not exist, it will be created on demand.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<ResolvedUser> ResolveUserFromInfoAsync(int contactId, string personName, string[] phoneNumbers, string[] emails, UserType userType, Credential credential, RequestOptions requestOptions = null)
```

#### Parameters

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

The contact Id of the contact which the person belongs to. Cannot be 0.

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

The full name of the person to be resolved. Optional.

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

Phone numbers registered on the person. Optional.

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

Email-addresses registered on the person. Optional.

`userType` [UserType](SuperOffice.WebApi.Data.UserType.md)

The type of user to look up or create.

`credential` [Credential](SuperOffice.WebApi.Data.Credential.md)

The credentials to be used for the user. Required.

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

The results of the resolve-operation.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveCredentialAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_Credential\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveCredentialAsync(int, Credential, RequestOptions)

Save (adds/replaces) current credential of the same type for the user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> SaveCredentialAsync(int userId, Credential credential, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary key of the user (i.e. associate)

`credential` [Credential](SuperOffice.WebApi.Data.Credential.md)

Credentials supported for authentication

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

True if the credential was successfully saved.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveExternalTokensAsync\_SuperOffice\_WebApi\_Data\_TokenManagementInfo\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveExternalTokensAsync(TokenManagementInfo, RequestOptions)

Saves the external tokens to the DB and returns a key that can be used to retrieve them
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> SaveExternalTokensAsync(TokenManagementInfo tokenManagementInfo, RequestOptions requestOptions = null)
```

#### Parameters

`tokenManagementInfo` [TokenManagementInfo](SuperOffice.WebApi.Data.TokenManagementInfo.md)

Token information.

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

Key that can be used to retrieve the tokens

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveRoleEntityAsync\_SuperOffice\_WebApi\_Data\_RoleEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveRoleEntityAsync(RoleEntity, RequestOptions)

Updates the existing RoleEntity or creates a new RoleEntity if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<RoleEntity> SaveRoleEntityAsync(RoleEntity roleEntity, RequestOptions requestOptions = null)
```

#### Parameters

`roleEntity` [RoleEntity](SuperOffice.WebApi.Data.RoleEntity.md)

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

New or updated RoleEntity

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveServiceAuthAsync\_SuperOffice\_WebApi\_Data\_ServiceAuth\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveServiceAuthAsync(ServiceAuth, RequestOptions)

Updates the existing ServiceAuth or creates a new ServiceAuth if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<ServiceAuth> SaveServiceAuthAsync(ServiceAuth serviceAuth, RequestOptions requestOptions = null)
```

#### Parameters

`serviceAuth` [ServiceAuth](SuperOffice.WebApi.Data.ServiceAuth.md)

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

New or updated ServiceAuth

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveUntrustedCredentialsAsync\_System\_String\_SuperOffice\_WebApi\_Data\_UntrustedCredentials\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveUntrustedCredentialsAsync(string, UntrustedCredentials, RequestOptions)

Save credentials for authenticated user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task SaveUntrustedCredentialsAsync(string type, UntrustedCredentials credentials, RequestOptions requestOptions = null)
```

#### Parameters

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

Type of credential(Ex: "imap", "smtp")

`credentials` [UntrustedCredentials](SuperOffice.WebApi.Data.UntrustedCredentials.md)

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveUntrustedCredentialsForAssociateAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_Data\_UntrustedCredentials\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveUntrustedCredentialsForAssociateAsync(int, string, UntrustedCredentials, RequestOptions)

Save credentials for a specified user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task SaveUntrustedCredentialsForAssociateAsync(int associateId, string type, UntrustedCredentials credentials, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of user to save credentials for.

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

Type of credential(Ex: "imap", "smtp")

`credentials` [UntrustedCredentials](SuperOffice.WebApi.Data.UntrustedCredentials.md)

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveUserAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveUserAsync(User, RequestOptions)

Updates the existing User or creates a new User if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> SaveUserAsync(User user, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.md)

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

New or updated User

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveUserFromNameAsync\_System\_String\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveUserFromNameAsync(string, User, RequestOptions)

Save a user, with lookup based on the user name.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<User> SaveUserFromNameAsync(string userName, User user, RequestOptions requestOptions = null)
```

#### Parameters

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

User name of the user to get.

`user` [User](SuperOffice.WebApi.Data.User.md)

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

User retrieved by name

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SaveUserGroupAsync\_SuperOffice\_WebApi\_Data\_UserGroup\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveUserGroupAsync(UserGroup, RequestOptions)

Save a user group.  Set UserGroup.Deleted to mark a user group as deleted and invisible in the user interface.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserGroup> SaveUserGroupAsync(UserGroup userGroup, RequestOptions requestOptions = null)
```

#### Parameters

`userGroup` [UserGroup](SuperOffice.WebApi.Data.UserGroup.md)

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

UserGroup as saved to the database

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SendChangePasswordEMailAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendChangePasswordEMailAsync(int, RequestOptions)

Send a change password email to this users registered address.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<OperationResult> SendChangePasswordEMailAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of the user to change password 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)\<[OperationResult](SuperOffice.WebApi.Data.OperationResult.md)\&gt;

Result - with result flag and optional error reason.

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SetDataRightAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_Data\_RoleRelationToOwner\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetDataRightAsync(int, string, RoleRelationToOwner, string, RequestOptions)

Set one specific data right at the given position. An exception will be thrown if non existing position is specified.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task SetDataRightAsync(int roleId, string tableName, RoleRelationToOwner relationToOwner, string dataRightValue, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to set the data right for

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

The name of the entity/table

`relationToOwner` [RoleRelationToOwner](SuperOffice.WebApi.Data.RoleRelationToOwner.md)

The id of the relation to owner

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

The data right value to set at the specified position (CRUD)

`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\_UserAgent\_SetExternalUserInfoAsync\_System\_Int32\_System\_String\_System\_String\_System\_Boolean\_System\_Int32\_SuperOffice\_WebApi\_Data\_ExternalUserInfoModification\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetExternalUserInfoAsync(int, string, string, bool, int, ExternalUserInfoModification, RequestOptions)

Modifies an external user. Changes external users information according to the flags set in  externalUserInfoModification.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task SetExternalUserInfoAsync(int associateId, string userName, string password, bool isActive, int roleId, ExternalUserInfoModification externalUserInfoModification, RequestOptions requestOptions = null)
```

#### Parameters

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

The associateId to alter.

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

Login username.

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

Login password.

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

Set isActive to true to enable the external user to log in.

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

Id of role for the external user. The role must be a role of type external users.

`externalUserInfoModification` [ExternalUserInfoModification](SuperOffice.WebApi.Data.ExternalUserInfoModification.md)

externalUserInfoModification is a flag describing what to change. \<see cref="SuperOffice.CRM.Services.Util.ExternalUserInfoModification"/>.

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

Set all functional rights for the given role. Functional rights not specified here will be removed from the role.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task SetFunctionalRightsAsync(int roleId, int[] functionalRightIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The role id to set the functional rights for

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

An array of functional rights ids to set for this role. Rights not included here are removed from the role.

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

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> SetGeneratedPasswordAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

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

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

Override language/culture codes on this request.

#### Returns

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

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SetGeneratedPasswordFromNameAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetGeneratedPasswordFromNameAsync(string, RequestOptions)

\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<string> SetGeneratedPasswordFromNameAsync(string associateName, RequestOptions requestOptions = null)
```

#### Parameters

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

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

Override language/culture codes on this request.

#### Returns

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

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

Change password for a user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> SetPasswordAsync(int associateId, string password, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of User to set password for

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

New password

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

Succeeded?

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SetPasswordFromNameAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetPasswordFromNameAsync(string, string, RequestOptions)

Change password for a user.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<bool> SetPasswordFromNameAsync(string associateName, string password, RequestOptions requestOptions = null)
```

#### Parameters

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

Username to set password for

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

New password

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

Succeeded?

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_SetUserPresenceStatusAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_UserPresenceStatus\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetUserPresenceStatusAsync(int, UserPresenceStatus, RequestOptions)

Set user presence status
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<UserPresenceStatus> SetUserPresenceStatusAsync(int associateId, UserPresenceStatus userPresenceStatus, RequestOptions requestOptions = null)
```

#### Parameters

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

AssociateId of user to set status for.

`userPresenceStatus` [UserPresenceStatus](SuperOffice.WebApi.Data.UserPresenceStatus.md)

User presence status to set

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

User presence status

### \<a id="SuperOffice\_WebApi\_Agents\_UserAgent\_ValidateUserAsync\_SuperOffice\_WebApi\_Data\_User\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateUserAsync(User, RequestOptions)

Check that entity is ready for saving, return error messages by field.
\<p>\</p>
\<b>Online Restricted:\</b> The User agent is not available in Online by default. User management is not allowed for partner apps.

```csharp theme={null}
public Task<StringDictionary> ValidateUserAsync(User user, RequestOptions requestOptions = null)
```

#### Parameters

`user` [User](SuperOffice.WebApi.Data.User.md)

Entity to be checked for errors.

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

Error messages tagged by field.
