Skip to main content

<a id=“SuperOffice_WebApi_Agents_UserAgent”></a> Class UserAgent

Namespace: SuperOffice.WebApi.Agents
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.

Inheritance

objectAgentBaseUserAgent

Implements

IUserAgent, IAgentBase, IDisposable

Inherited Members

AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T&gt;(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“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

Parameters

httpClient 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

Parameters

options WebApiOptions Base URL and authentication values. httpClient 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.

Parameters

contactId int Id of the contact to add as a owner contact requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

associateId int AssociateId of the user to check if password can be changed requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

oldPassword string The current password of the user. Administrators can leave this blank to force a new password upon a user. newPassword string The new password for the user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int AssociateId of the user to change password for. oldPassword string The current password of the user. Administrators can leave this blank to force a new password upon a user. newPassword string The new password for the user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateName string Username of the user to change password for. oldPassword string The current password of the user. Administrators can leave this blank to force a new password upon a user. newPassword string The new password for the user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

user User User name of the user to get. userType UserType requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RoleEntity&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.

Parameters

type RoleType Type of role (Employee/External/Anonymous/System) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RoleEntity&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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ServiceAuth&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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UntrustedCredentials&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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

userType UserType Type of associate for the user contactId int Contact id of the person credentialType string Type of credentials, corresponding to name of plugin and type in the credentials table. credentialValue string This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory credentialDisplayValue string The value displayed to the user. this will typically be the users login name in active directory. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

userType UserType Type of associate for the user personId int Primary key of the person to become a user. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

userType UserType 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 Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

personId int The personId to create an external user for. userName string Login username. password string Login password. roleId int Id of role for the external user. The role must be a role of type external users. isActive bool Set isActive to true to enable the external user to log in. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&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.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserGroup&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.

Parameters

tokenManagementInfo TokenManagementInfo Token information. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

userId int Primary key of the user (i.e. associate) credentialType string Type of credentials, corresponding to name of plugin and type in the credentials table requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int The associateId to delete the associate entry for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

roleIdToDelete int The roleId to delete replacingRoleId int The roleId which all associated users will be moved to. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

serviceAuthId int The identity of the ServiceAuth requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

userId int The identity of the User requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

userName string User name of the user to delete. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

userGroupToDelete int The id of the userGroup to delete userGroupToMoveTo int The id of the userGroup to move the members to requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

provider string The provider of the underlying data. authorizationCode string The authorization code to exchange for a token. nonce string The nonce to verify against the id_token’s nonce if present. pkceVerifier string The cryptographic proof for the client to verify. redirectUri string We need to be able to dynamically inject the redirect based on location(app.superoffice.com vs online2.superoffice.com) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

commandName string The name of the command to execute. actionResult CommandActionResult Result of an UI operation. user User The User to execute commands on. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CommandResult&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.

Parameters

type string Type of credentials, corresponding to name of plugin and type in the credentials table. searchString string Partly name of the user group requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CredentialsGroupUsers&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.

Parameters

type string Type of credentials, corresponding to name of plugin and type in the credentials table. searchString string Partly name of domain group. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CredentialsGroup[]&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.

Parameters

functionalRightName string Functional right name to search for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<MDOListItem[]&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.

Parameters

functionalRightNames string[] An array of functional rights names to search for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int[]&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.

Parameters

functionalRightNames string[] An array of functional rights names to search for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int[]&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.

Parameters

associateName string The name of the associate to change the password for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<AccessGatewayInfo&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.

Parameters

app_token string Application token to get access on behalf of. Optional. includeCsSession bool Initialize CS session for this access token?. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

roleId int The role id to set the functional rights for relationToOwner RoleRelationToOwner The id of the relation to owner requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&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.

Parameters

roleType RoleType Type of role (Employee/External/Anonymous/System) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SelectableMDOListItem[]&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.

Parameters

roleType RoleType Type of role (Employee/External/Anonymous/System) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SelectableMDOListItem[]&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.

Parameters

includeDeleted bool Include user groups with Deleted set to true requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserGroup[]&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.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CredentialType[]&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.

Parameters

userType UserType The user type to retrieve credential types for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CredentialType[]&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.

Parameters

type string Type of credentials, corresponding to name of plugin and type in the credentials table. groupName string Name of user group needed to discover the users. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CredentialsGroupUsers&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

Parameters

requestOptions RequestOptions

Returns

Task<SoPrincipalCarrier&gt;

<a id=“SuperOffice_WebApi_Agents_UserAgent_GetCurrentToken_SuperOffice_WebApi_RequestOptions_”></a> GetCurrentToken(RequestOptions)

Get the current token for the currently logged in user

Parameters

requestOptions RequestOptions

Returns

Task<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.

Parameters

roleId int The role id to set the data right for tableName string The name of the entity/table relationToOwner RoleRelationToOwner The id of the relation to owner requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

roleId int The role id to set the data right for tableName string The name of the entity/table requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&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.

Parameters

user User requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

key string Token retrievel key requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TokenManagementInfo&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.

Parameters

roleId int The role id to get the functional rights for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SelectableMDOListItem[]&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.

Parameters

redirectUri string This is the registered redirect_uri for AccessGateway OIDC. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<AccessGatewayInfo&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.

Parameters

roleId int The identifier of the Role object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Role&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.

Parameters

roleEntityId int The identifier of the RoleEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RoleEntity&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.

Parameters

serviceAuthId int The identifier of the ServiceAuth object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ServiceAuth&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.

Parameters

associateId int AssociateId of the user to check if password can be changed requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ChangePasswordType[]&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.

Parameters

type string Type of credential(Ex: “imap”, “smtp”). requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UntrustedCredentials[]&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.

Parameters

associateId int Id of user to retrieve credentials for. type string Type of credential(Ex: “imap”, “smtp”). requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UntrustedCredentials[]&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.

Parameters

userId int The identifier of the User object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

user User The User requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomCommand[]&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.

Parameters

ejUserId int ejUserId - requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User[]&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.

Parameters

userName string User name of the user to get. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

personId int requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User[]&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.

Parameters

userGroupId int The identifier of the UserGroup object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserGroup&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.

Parameters

userGroupIds int[] The identifiers of the UserGroup object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserGroup[]&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.

Parameters

userInfoId int The identifier of the UserInfo object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserInfo&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.

Parameters

userInfoIds int[] The identifiers of the UserInfo object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserInfo[]&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.

Parameters

associateId int AssociateId of user to retrieve status for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserPresenceStatus&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.

Parameters

associateId int type UserType personId int userName string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

user User requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

associateId int nickName string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int type UserType personId int password string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int type UserType personId int password string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserValidationResult&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.

Parameters

associateId int type UserType personId int userName string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int type UserType personId int userName string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserValidationResult&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.

Parameters

associateId int retired bool requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

redirectUri string This is the registered redirect_uri for AccessGateway OIDC. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<AccessGatewayInfo&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.

Parameters

associateId int requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

contactId int The id of the contact to remove requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

type string Type of credential(Ex: “imap”, “smtp”) publicValue string PublicValue field of credentials to remove. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

associateId int Id of user to remove credentials for. type string Type of credential(Ex: “imap”, “smtp”) publicValue string PublicValue field of credentials to remove. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

contactId int The contact Id of the contact which the person belongs to. Cannot be 0. personName string The full name of the person to be resolved. Optional. phoneNumbers string[] Phone numbers registered on the person. Optional. emails string[] Email-addresses registered on the person. Optional. userType UserType The type of user to look up or create. credential Credential The credentials to be used for the user. Required. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ResolvedUser&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.

Parameters

userId int Primary key of the user (i.e. associate) credential Credential Credentials supported for authentication requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

tokenManagementInfo TokenManagementInfo Token information. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

roleEntity RoleEntity The RoleEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RoleEntity&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.

Parameters

serviceAuth ServiceAuth The ServiceAuth that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ServiceAuth&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.

Parameters

type string Type of credential(Ex: “imap”, “smtp”) credentials UntrustedCredentials Credentials to save. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

associateId int Id of user to save credentials for. type string Type of credential(Ex: “imap”, “smtp”) credentials UntrustedCredentials Credentials to save. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

user User The User that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

userName string User name of the user to get. user User User object to save. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<User&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.

Parameters

userGroup UserGroup UserGroup to save requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserGroup&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.

Parameters

associateId int AssociateId of the user to change password for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<OperationResult&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.

Parameters

roleId int The role id to set the data right for tableName string The name of the entity/table relationToOwner RoleRelationToOwner The id of the relation to owner dataRightValue string The data right value to set at the specified position (CRUD) requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

associateId int The associateId to alter. userName string Login username. password string Login password. isActive bool Set isActive to true to enable the external user to log in. roleId int Id of role for the external user. The role must be a role of type external users. externalUserInfoModification ExternalUserInfoModification externalUserInfoModification is a flag describing what to change. <see cref=“SuperOffice.CRM.Services.Util.ExternalUserInfoModification”/>. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

roleId int The role id to set the functional rights for functionalRightIds int[] An array of functional rights ids to set for this role. Rights not included here are removed from the role. requestOptions RequestOptions Override language/culture codes on this request.

Returns

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.

Parameters

associateId int requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

associateName string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<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.

Parameters

associateId int Id of User to set password for password string New password requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateName string Username to set password for password string New password requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&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.

Parameters

associateId int AssociateId of user to set status for. userPresenceStatus UserPresenceStatus User presence status to set requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserPresenceStatus&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.

Parameters

user User Entity to be checked for errors. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&gt; Error messages tagged by field.