Class UserAgent
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class UserAgent : AgentBase<IUserAgent>, IDisposable, IUserAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
Constructors
UserAgent()
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public UserAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
Methods
AddOwnerContact(Int32)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public void AddOwnerContact(int contactId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | Id of the contact to add as a owner contact |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CanChangePassword(Int32)
Check if the current assoicate can change the password for an associate
Declaration
public bool CanChangePassword(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of the user to check if password can be changed |
Returns
Type | Description |
---|---|
Boolean | True if the associate can change the password |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ChangeOwnPassword(String, String)
Change password for a user.
Declaration
public bool ChangeOwnPassword(string oldPassword, string newPassword)
Parameters
Type | Name | Description |
---|---|---|
String | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
String | newPassword | The new password for the user |
Returns
Type | Description |
---|---|
Boolean | True if the password was successfully changed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ChangePassword(Int32, String, String)
Change password for a user.
Declaration
public bool ChangePassword(int associateId, string oldPassword, string newPassword)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of the user to change password for. |
String | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
String | newPassword | The new password for the user |
Returns
Type | Description |
---|---|
Boolean | True if the password was successfully changed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ChangePasswordFromName(String, String, String)
Change password for a user.
Declaration
public bool ChangePasswordFromName(string associateName, string oldPassword, string newPassword)
Parameters
Type | Name | Description |
---|---|---|
String | associateName | Username of the user to change password for. |
String | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
String | newPassword | The new password for the user |
Returns
Type | Description |
---|---|
Boolean | True if the password was successfully changed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ChangeUserType(User, UserType)
Get a user from the user name.
Declaration
public User ChangeUserType(User user, UserType userType)
Parameters
Type | Name | Description |
---|---|---|
User | user | User name of the user to get. |
UserType | userType |
Returns
Type | Description |
---|---|
User | User retrieved by name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CheckAccessGatewayRegistration()
Checks if AccessGatewayRegistration is valid
Declaration
public bool CheckAccessGatewayRegistration()
Returns
Type | Description |
---|---|
Boolean | True if the registration is usable |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultRoleEntity()
Loading default values into a new RoleEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public RoleEntity CreateDefaultRoleEntity()
Returns
Type | Description |
---|---|
RoleEntity | New RoleEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultRoleEntityFromType(RoleType)
Create a new role entity of the specified role type. The role type cannot be changed after the entity is created.
Declaration
public RoleEntity CreateDefaultRoleEntityFromType(RoleType type)
Parameters
Type | Name | Description |
---|---|---|
RoleType | type | Type of role (Employee/External/Anonymous/System) |
Returns
Type | Description |
---|---|
RoleEntity | A blank role. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultServiceAuth()
Loading default values into a new ServiceAuth. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public ServiceAuth CreateDefaultServiceAuth()
Returns
Type | Description |
---|---|
ServiceAuth | New ServiceAuth with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultUntrustedCredentials()
Loading default values into a new UntrustedCredentials. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public UntrustedCredentials CreateDefaultUntrustedCredentials()
Returns
Type | Description |
---|---|
UntrustedCredentials | New UntrustedCredentials with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultUser()
Loading default values into a new User. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public User CreateDefaultUser()
Returns
Type | Description |
---|---|
User | New User with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultUserFromUserType(UserType)
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.
Declaration
public User CreateDefaultUserFromUserType(UserType userType)
Parameters
Type | Name | Description |
---|---|---|
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. |
Returns
Type | Description |
---|---|
User | New user object with defalt values set. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultUserFromUserTypeAndCredential(UserType, Int32, String, String, String)
Creates a PersonEntity with default values based on the contactId and credentials.
Declaration
public User CreateDefaultUserFromUserTypeAndCredential(UserType userType, int contactId, string credentialType, string credentialValue, string credentialDisplayValue)
Parameters
Type | Name | Description |
---|---|---|
UserType | userType | Type of associate for the user |
Int32 | contactId | Contact id of the person |
String | credentialType | Type of credentials, corresponding to name of plugin and type in the credentials table. |
String | credentialValue | This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory |
String | credentialDisplayValue | The value displayed to the user. this will typically be the users login name in active directory. |
Returns
Type | Description |
---|---|
User |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateDefaultUserFromUserTypeAndPersonId(UserType, Int32)
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.
Declaration
public User CreateDefaultUserFromUserTypeAndPersonId(UserType userType, int personId)
Parameters
Type | Name | Description |
---|---|---|
UserType | userType | Type of associate for the user |
Int32 | personId | Primary key of the person to become a user. |
Returns
Type | Description |
---|---|
User | New user object with defalt values set. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateExternalUser(Int32, String, String, Int32, Boolean)
Creates an associate of type external user.
Declaration
public int CreateExternalUser(int personId, string userName, string password, int roleId, bool isActive)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId | The personId to create an external user for. |
String | userName | Login username. |
String | password | Login password. |
Int32 | roleId | Id of role for the external user. The role must be a role of type external users. |
Boolean | isActive | Set isActive to true to enable the external user to log in. |
Returns
Type | Description |
---|---|
Int32 | Returns the created associateId. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
CreateUserGroup()
Create UserGroup (Rank is assigned to the highest rank)
Declaration
public UserGroup CreateUserGroup()
Returns
Type | Description |
---|---|
UserGroup |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DecryptAndSaveExternalTokens(TokenManagementInfo)
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
Declaration
public string DecryptAndSaveExternalTokens(TokenManagementInfo tokenManagementInfo)
Parameters
Type | Name | Description |
---|---|---|
TokenManagementInfo | tokenManagementInfo | Token information. |
Returns
Type | Description |
---|---|
String | Key that can be used to retrieve the tokens |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteCredential(Int32, String)
Remove credential of a specific type for a user
Declaration
public bool DeleteCredential(int userId, string credentialType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | Primary key of the user (i.e. associate) |
String | credentialType | Type of credentials, corresponding to name of plugin and type in the credentials table |
Returns
Type | Description |
---|---|
Boolean | True if credential was sucessfully removed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteExternalUser(Int32)
Deletes an associate of type external user.
Declaration
public void DeleteExternalUser(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | The associateId to delete the associate entry for. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteRole(Int32, Int32)
Delete the specified role and move all users associated with the role to the replacingRoleId
Declaration
public void DeleteRole(int roleIdToDelete, int replacingRoleId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleIdToDelete | The roleId to delete |
Int32 | replacingRoleId | The roleId which all associated users will be moved to. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteServiceAuth(Int32)
Deletes the ServiceAuth
Declaration
public void DeleteServiceAuth(int serviceAuthId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | serviceAuthId | The identity of the ServiceAuth |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteUser(Int32)
Deletes the User
Declaration
public void DeleteUser(int userId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | The identity of the User |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteUserFromName(String)
Delete a user, with lookup based on the user name.
Declaration
public void DeleteUserFromName(string userName)
Parameters
Type | Name | Description |
---|---|---|
String | userName | User name of the user to delete. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
DeleteUserGroup(Int32, Int32)
Delete a usergroup and move its members to another usergroup
Declaration
public void DeleteUserGroup(int userGroupToDelete, int userGroupToMoveTo)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userGroupToDelete | The id of the userGroup to delete |
Int32 | userGroupToMoveTo | The id of the userGroup to move the members to |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ExecuteUserCommand(String, CommandActionResult, User)
Executes the custom command for User
Declaration
public CommandResult ExecuteUserCommand(string commandName, CommandActionResult actionResult, User user)
Parameters
Type | Name | Description |
---|---|---|
String | commandName | The name of the command to execute. |
CommandActionResult | actionResult | Result of an UI operation. |
User | user | The User to execute commands on. |
Returns
Type | Description |
---|---|
CommandResult | Result of the executed command |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
FindCredentialsGroups(String, String)
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.
Declaration
public CredentialsGroup[] FindCredentialsGroups(string type, string searchString)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
String | searchString | Partly name of domain group. |
Returns
Type | Description |
---|---|
CredentialsGroup[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
FindCredentialUsers(String, String)
Find users matching the partial name.
Declaration
public CredentialsGroupUsers FindCredentialUsers(string type, string searchString)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
String | searchString | Partly name of the user group |
Returns
Type | Description |
---|---|
CredentialsGroupUsers |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
FindRolesWithFunctionalRight(String)
Find all roles with a given functional right. The roles matched must contain the specified functional right.
Declaration
public MDOListItem[] FindRolesWithFunctionalRight(string functionalRightName)
Parameters
Type | Name | Description |
---|---|---|
String | functionalRightName | Functional right name to search for |
Returns
Type | Description |
---|---|
MDOListItem[] | Roles that contains the given functional right |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
FindRolesWithFunctionalRights(String[])
Find all roles with a given set of functional rights. The roles matched must contain one or more of the specified functional rights.
Declaration
public int[] FindRolesWithFunctionalRights(string[] functionalRightNames)
Parameters
Type | Name | Description |
---|---|---|
String[] | functionalRightNames | An array of functional rights names to search for |
Returns
Type | Description |
---|---|
Int32[] | Role ids that contains your functional rights |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
FindRolesWithoutFunctionalRights(String[])
Find all roles without a given set of functional rights. The roles matched must not contain any of the specified functional rights.
Declaration
public int[] FindRolesWithoutFunctionalRights(string[] functionalRightNames)
Parameters
Type | Name | Description |
---|---|---|
String[] | functionalRightNames | An array of functional rights names to search for |
Returns
Type | Description |
---|---|
Int32[] | Role ids that without your functional rights |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GenerateNewPasswordForExternalUser(String)
Generates a new password for an external user.
Declaration
public string GenerateNewPasswordForExternalUser(string associateName)
Parameters
Type | Name | Description |
---|---|---|
String | associateName | The name of the associate to change the password for. |
Returns
Type | Description |
---|---|
String | Returns the generated password. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetAccessGatewayInfo()
Returns accessgateway registration info
Declaration
public AccessGatewayInfo GetAccessGatewayInfo()
Returns
Type | Description |
---|---|
AccessGatewayInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetAccessToken(String, Boolean)
Get an access token based on the current user's session.
Declaration
public string GetAccessToken(string app_token, bool includeCsSession)
Parameters
Type | Name | Description |
---|---|---|
String | app_token | Application token to get access on behalf of. Optional. |
Boolean | includeCsSession | Initialize CS session for this access token?. |
Returns
Type | Description |
---|---|
String | An access token. "8A:xyz123==" |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetAllFunctionalRights(RoleType)
Get a list of all functional rights for the given type of role. MDO List name = 'FunctionRights', extra='roleType=0'
Declaration
public SelectableMDOListItem[] GetAllFunctionalRights(RoleType roleType)
Parameters
Type | Name | Description |
---|---|---|
RoleType | roleType | Type of role (Employee/External/Anonymous/System) |
Returns
Type | Description |
---|---|
SelectableMDOListItem[] | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetAllRoles(RoleType)
Get a list of all roles for the given type of role. MDO List name = 'Roles', extra='0' (roleType)
Declaration
public SelectableMDOListItem[] GetAllRoles(RoleType roleType)
Parameters
Type | Name | Description |
---|---|---|
RoleType | roleType | Type of role (Employee/External/Anonymous/System) |
Returns
Type | Description |
---|---|
SelectableMDOListItem[] | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetAllUserGroups(Boolean)
Get all user groups
Declaration
public UserGroup[] GetAllUserGroups(bool includeDeleted)
Parameters
Type | Name | Description |
---|---|---|
Boolean | includeDeleted | Include user groups with Deleted set to true |
Returns
Type | Description |
---|---|
UserGroup[] | All user groups |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetCredentialTypes()
Get available credential types that can be used for authentication
Declaration
public CredentialType[] GetCredentialTypes()
Returns
Type | Description |
---|---|
CredentialType[] | Credential types that can be used for authentication |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetCredentialTypesForUserType(UserType)
Get available credential types that can be used for the specified user type.
Declaration
public CredentialType[] GetCredentialTypesForUserType(UserType userType)
Parameters
Type | Name | Description |
---|---|---|
UserType | userType | The user type to retrieve credential types for |
Returns
Type | Description |
---|---|
CredentialType[] | Credential types that can be used for authentication |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetCredentialUsersInGroup(String, String)
Get credential users within a user group
Declaration
public CredentialsGroupUsers GetCredentialUsersInGroup(string type, string groupName)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
String | groupName | Name of user group needed to discover the users. |
Returns
Type | Description |
---|---|
CredentialsGroupUsers |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetDataRight(Int32, String, RoleRelationToOwner)
Read one specific data right at the given position. An exception will be thrown if non existing position is specified.
Declaration
public string GetDataRight(int roleId, string tableName, RoleRelationToOwner relationToOwner)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The role id to set the data right for |
String | tableName | The name of the entity/table |
RoleRelationToOwner | relationToOwner | The id of the relation to owner |
Returns
Type | Description |
---|---|
String | The data right value at the specified position (C, CR, CRU, or CRUD) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetDataRights(Int32, String)
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.
Declaration
public StringDictionary GetDataRights(int roleId, string tableName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The role id to set the data right for |
String | tableName | The name of the entity/table |
Returns
Type | Description |
---|---|
StringDictionary | The data right values for all the defined relationships (C, CR, CRU, or CRUD) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetDefaultAssociateUserName(User)
Get the default username for a person
Declaration
public string GetDefaultAssociateUserName(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user |
Returns
Type | Description |
---|---|
String |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetExternalTokens(String)
Retrieve the tokens from the DB based on the given key
Declaration
public TokenManagementInfo GetExternalTokens(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | Token retrievel key |
Returns
Type | Description |
---|---|
TokenManagementInfo | Key to retrieve tokens |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetFunctionalRights(Int32)
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'
Declaration
public SelectableMDOListItem[] GetFunctionalRights(int roleId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The role id to get the functional rights for. |
Returns
Type | Description |
---|---|
SelectableMDOListItem[] | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetOrRegisterAccessGatewayInfo(String)
Returns accessgateway registration info and registers a new or adds the url if necessary
Declaration
public AccessGatewayInfo GetOrRegisterAccessGatewayInfo(string redirectUri)
Parameters
Type | Name | Description |
---|---|---|
String | redirectUri | This is the registered redirect_uri for AccessGateway OIDC. |
Returns
Type | Description |
---|---|
AccessGatewayInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetRole(Int32)
Gets a Role object.
Declaration
public Role GetRole(int roleId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The identifier of the Role object |
Returns
Type | Description |
---|---|
Role | Role |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetRoleEntity(Int32)
Gets a RoleEntity object.
Declaration
public RoleEntity GetRoleEntity(int roleEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleEntityId | The identifier of the RoleEntity object |
Returns
Type | Description |
---|---|
RoleEntity | RoleEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetServiceAuth(Int32)
Gets a ServiceAuth object.
Declaration
public ServiceAuth GetServiceAuth(int serviceAuthId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | serviceAuthId | The identifier of the ServiceAuth object |
Returns
Type | Description |
---|---|
ServiceAuth | ServiceAuth |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetSupportedChangePasswordTypes(Int32)
Get the different methods the user can use to change password
Declaration
public ChangePasswordType[] GetSupportedChangePasswordTypes(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of the user to check if password can be changed |
Returns
Type | Description |
---|---|
ChangePasswordType[] | List of types - empty if the user cannot change password in any way |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUntrustedCredentials(String)
Get a set of credentials of a specified type for authenticated user.
Declaration
public UntrustedCredentials[] GetUntrustedCredentials(string type)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credential(Ex: "imap", "smtp"). |
Returns
Type | Description |
---|---|
UntrustedCredentials[] | Array of credentials of the specified type. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUntrustedCredentialsForAssociate(Int32, String)
Get a set of credentials of a specified type for a specified user. SecretValue is only populated for authenticated user, and system users.
Declaration
public UntrustedCredentials[] GetUntrustedCredentialsForAssociate(int associateId, string type)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Id of user to retrieve credentials for. |
String | type | Type of credential(Ex: "imap", "smtp"). |
Returns
Type | Description |
---|---|
UntrustedCredentials[] | Array of credentials of the specified type. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUser(Int32)
Gets a User object.
Declaration
public User GetUser(int userId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | The identifier of the User object |
Returns
Type | Description |
---|---|
User | User |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserCommands(User)
Get registered custom commands for User
Declaration
public CustomCommand[] GetUserCommands(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user | The User |
Returns
Type | Description |
---|---|
CustomCommand[] | Custom commands for the User |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserFromEjUserId(Int32)
Get user from ejUserId - used for eJournal Legacy Support.
Declaration
public User[] GetUserFromEjUserId(int ejUserId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ejUserId | ejUserId - |
Returns
Type | Description |
---|---|
User[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserFromName(String)
Get a user, with lookup based on user name.
Declaration
public User GetUserFromName(string userName)
Parameters
Type | Name | Description |
---|---|---|
String | userName | User name of the user to get. |
Returns
Type | Description |
---|---|
User | User retrieved by name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserFromPersonId(Int32)
Returns the user associated with the supplied person id
Declaration
public User[] GetUserFromPersonId(int personId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | personId |
Returns
Type | Description |
---|---|
User[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserGroup(Int32)
Gets a UserGroup object.
Declaration
public UserGroup GetUserGroup(int userGroupId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userGroupId | The identifier of the UserGroup object |
Returns
Type | Description |
---|---|
UserGroup | UserGroup |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserGroupList(Int32[])
Gets an array of UserGroup objects.
Declaration
public UserGroup[] GetUserGroupList(int[] userGroupIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | userGroupIds | The identifiers of the UserGroup object |
Returns
Type | Description |
---|---|
UserGroup[] | Array of UserGroup objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserInfo(Int32)
Gets a UserInfo object.
Declaration
public UserInfo GetUserInfo(int userInfoId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userInfoId | The identifier of the UserInfo object |
Returns
Type | Description |
---|---|
UserInfo | UserInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserInfoList(Int32[])
Gets an array of UserInfo objects.
Declaration
public UserInfo[] GetUserInfoList(int[] userInfoIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | userInfoIds | The identifiers of the UserInfo object |
Returns
Type | Description |
---|---|
UserInfo[] | Array of UserInfo objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetUserPresenceStatus(Int32)
Get user presence status
Declaration
public UserPresenceStatus GetUserPresenceStatus(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of user to retrieve status for. |
Returns
Type | Description |
---|---|
UserPresenceStatus | User presence status |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetValidUserName(Int32, UserType, Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public string GetValidUserName(int associateId, UserType type, int personId, string userName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
UserType | type | |
Int32 | personId | |
String | userName |
Returns
Type | Description |
---|---|
String |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
GetValidUserNameForNewUser(User)
Generates a valid username for an unsaved user
Declaration
public string GetValidUserNameForNewUser(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user |
Returns
Type | Description |
---|---|
String |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
IsNickNameUnique(Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public bool IsNickNameUnique(int associateId, string nickName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
String | nickName |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
IsPasswordValid(Int32, UserType, Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public bool IsPasswordValid(int associateId, UserType type, int personId, string password)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
UserType | type | |
Int32 | personId | |
String | password |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
IsPasswordValidWithReason(Int32, UserType, Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public UserValidationResult IsPasswordValidWithReason(int associateId, UserType type, int personId, string password)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
UserType | type | |
Int32 | personId | |
String | password |
Returns
Type | Description |
---|---|
UserValidationResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
IsUserNameValid(Int32, UserType, Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public bool IsUserNameValid(int associateId, UserType type, int personId, string userName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
UserType | type | |
Int32 | personId | |
String | userName |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
IsUserNameValidWithReason(Int32, UserType, Int32, String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public UserValidationResult IsUserNameValidWithReason(int associateId, UserType type, int personId, string userName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
UserType | type | |
Int32 | personId | |
String | userName |
Returns
Type | Description |
---|---|
UserValidationResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
MakeRetired(Int32, Boolean)
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
Declaration
public void MakeRetired(int associateId, bool retired)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | |
Boolean | retired |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
RegisterWithAccessGateway(String)
Registers with access gateway if not already done, otherwise will attempt to update
Declaration
public AccessGatewayInfo RegisterWithAccessGateway(string redirectUri)
Parameters
Type | Name | Description |
---|---|---|
String | redirectUri | This is the registered redirect_uri for AccessGateway OIDC. |
Returns
Type | Description |
---|---|
AccessGatewayInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
RemoveLicenses(Int32)
Remove all user licenses.
Declaration
public void RemoveLicenses(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
RemoveOwnerContact(Int32)
Remove a contact from the ownercontactlink table
Declaration
public void RemoveOwnerContact(int contactId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The id of the contact to remove |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
RemoveUntrustedCredentials(String, String)
Remove a credentials entry for authenticated user.
Declaration
public void RemoveUntrustedCredentials(string type, string publicValue)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credential(Ex: "imap", "smtp") |
String | publicValue | PublicValue field of credentials to remove. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
RemoveUntrustedCredentialsForAssociate(Int32, String, String)
Remove a credentials entry for a specified user.
Declaration
public void RemoveUntrustedCredentialsForAssociate(int associateId, string type, string publicValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Id of user to remove credentials for. |
String | type | Type of credential(Ex: "imap", "smtp") |
String | publicValue | PublicValue field of credentials to remove. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ResolveUserFromInfo(Int32, String, String[], String[], UserType, Credential)
Get a user from the provided information. If the user or associated person does not exist, it will be created on demand.
Declaration
public ResolvedUser ResolveUserFromInfo(int contactId, string personName, string[] phoneNumbers, string[] emails, UserType userType, Credential credential)
Parameters
Type | Name | Description |
---|---|---|
Int32 | contactId | The contact Id of the contact which the person belongs to. Cannot be 0. |
String | personName | The full name of the person to be resolved. Optional. |
String[] | phoneNumbers | Phone numbers registered on the person. Optional. |
String[] | emails | 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. |
Returns
Type | Description |
---|---|
ResolvedUser | The results of the resolve-operation. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveCredential(Int32, Credential)
Save (adds/replaces) current credential of the same type for the user.
Declaration
public bool SaveCredential(int userId, Credential credential)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | Primary key of the user (i.e. associate) |
Credential | credential | Credentials supported for authentication |
Returns
Type | Description |
---|---|
Boolean | True if the credential was successfully saved. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveExternalTokens(TokenManagementInfo)
Saves the external tokens to the DB and returns a key that can be used to retrieve them
Declaration
public string SaveExternalTokens(TokenManagementInfo tokenManagementInfo)
Parameters
Type | Name | Description |
---|---|---|
TokenManagementInfo | tokenManagementInfo | Token information. |
Returns
Type | Description |
---|---|
String | Key that can be used to retrieve the tokens |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveRoleEntity(RoleEntity)
Updates the existing RoleEntity or creates a new RoleEntity if the id parameter is empty
Declaration
public RoleEntity SaveRoleEntity(RoleEntity roleEntity)
Parameters
Type | Name | Description |
---|---|---|
RoleEntity | roleEntity | The RoleEntity that is saved. |
Returns
Type | Description |
---|---|
RoleEntity | New or updated RoleEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveServiceAuth(ServiceAuth)
Updates the existing ServiceAuth or creates a new ServiceAuth if the id parameter is empty
Declaration
public ServiceAuth SaveServiceAuth(ServiceAuth serviceAuth)
Parameters
Type | Name | Description |
---|---|---|
ServiceAuth | serviceAuth | The ServiceAuth that is saved. |
Returns
Type | Description |
---|---|
ServiceAuth | New or updated ServiceAuth |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveUntrustedCredentials(String, UntrustedCredentials)
Save credentials for authenticated user.
Declaration
public void SaveUntrustedCredentials(string type, UntrustedCredentials credentials)
Parameters
Type | Name | Description |
---|---|---|
String | type | Type of credential(Ex: "imap", "smtp") |
UntrustedCredentials | credentials | Credentials to save. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveUntrustedCredentialsForAssociate(Int32, String, UntrustedCredentials)
Save credentials for a specified user.
Declaration
public void SaveUntrustedCredentialsForAssociate(int associateId, string type, UntrustedCredentials credentials)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Id of user to save credentials for. |
String | type | Type of credential(Ex: "imap", "smtp") |
UntrustedCredentials | credentials | Credentials to save. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveUser(User)
Updates the existing User or creates a new User if the id parameter is empty
Declaration
public User SaveUser(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user | The User that is saved. |
Returns
Type | Description |
---|---|
User | New or updated User |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveUserFromName(String, User)
Save a user, with lookup based on the user name.
Declaration
public User SaveUserFromName(string userName, User user)
Parameters
Type | Name | Description |
---|---|---|
String | userName | User name of the user to get. |
User | user | User object to save. |
Returns
Type | Description |
---|---|
User | User retrieved by name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SaveUserGroup(UserGroup)
Save a user group. Set UserGroup.Deleted to mark a user group as deleted and invisible in the user interface.
Declaration
public UserGroup SaveUserGroup(UserGroup userGroup)
Parameters
Type | Name | Description |
---|---|---|
UserGroup | userGroup | UserGroup to save |
Returns
Type | Description |
---|---|
UserGroup | UserGroup as saved to the database |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SendChangePasswordEMail(Int32)
Send a change password email to this users registered address.
Declaration
public OperationResult SendChangePasswordEMail(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of the user to change password for. |
Returns
Type | Description |
---|---|
OperationResult | Result - with result flag and optional error reason. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetDataRight(Int32, String, RoleRelationToOwner, String)
Set one specific data right at the given position. An exception will be thrown if non existing position is specified.
Declaration
public void SetDataRight(int roleId, string tableName, RoleRelationToOwner relationToOwner, string dataRightValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The role id to set the data right for |
String | tableName | The name of the entity/table |
RoleRelationToOwner | relationToOwner | The id of the relation to owner |
String | dataRightValue | The data right value to set at the specified position (CRUD) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetExternalUserInfo(Int32, String, String, Boolean, Int32, ExternalUserInfoModification)
Modifies an external user. Changes external users information according to the flags set in externalUserInfoModification.
Declaration
public void SetExternalUserInfo(int associateId, string userName, string password, bool isActive, int roleId, ExternalUserInfoModification externalUserInfoModification)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | The associateId to alter. |
String | userName | Login username. |
String | password | Login password. |
Boolean | isActive | Set isActive to true to enable the external user to log in. |
Int32 | roleId | 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"/>. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetFunctionalRights(Int32, Int32[])
Set all functional rights for the given role. Functional rights not specified here will be removed from the role.
Declaration
public void SetFunctionalRights(int roleId, int[] functionalRightIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | roleId | The role id to set the functional rights for |
Int32[] | functionalRightIds | An array of functional rights ids to set for this role. Rights not included here are removed from the role. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetGeneratedPassword(Int32)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public string SetGeneratedPassword(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId |
Returns
Type | Description |
---|---|
String |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetGeneratedPasswordFromName(String)
Facade for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Declaration
public string SetGeneratedPasswordFromName(string associateName)
Parameters
Type | Name | Description |
---|---|---|
String | associateName |
Returns
Type | Description |
---|---|
String |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetPassword(Int32, String)
Change password for a user.
Declaration
public bool SetPassword(int associateId, string password)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Id of User to set password for |
String | password | New password |
Returns
Type | Description |
---|---|
Boolean | Succeeded? |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetPasswordFromName(String, String)
Change password for a user.
Declaration
public bool SetPasswordFromName(string associateName, string password)
Parameters
Type | Name | Description |
---|---|---|
String | associateName | Username to set password for |
String | password | New password |
Returns
Type | Description |
---|---|
Boolean | Succeeded? |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
SetUserPresenceStatus(Int32, UserPresenceStatus)
Set user presence status
Declaration
public UserPresenceStatus SetUserPresenceStatus(int associateId, UserPresenceStatus userPresenceStatus)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | AssociateId of user to set status for. |
UserPresenceStatus | userPresenceStatus | User presence status to set |
Returns
Type | Description |
---|---|
UserPresenceStatus | User presence status |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
ValidateUser(User)
Check that entity is ready for saving, return error messages by field.
Declaration
public StringDictionary ValidateUser(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user | Entity to be checked for errors. |
Returns
Type | Description |
---|---|
StringDictionary | Error messages tagged by field. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}