Interface IPhoneListAgent
Interface for the PhoneList Agent Collection of all services for searching for person or contact (company) phone numbers.
Namespace: SuperOfficeCRMServices
Assembly: SuperOffice.Services.dll
Syntax
[Agent("PhoneList Agent", "Interface for the PhoneList Agent. Collection of all services for searching for person or contact (company) phone numbers.")]
public interface IPhoneListAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PhoneListAgent agent = new PhoneListAgent())
{
// call methods on agent here...
}
}
Methods
AddToFavoritesAsync(int, CancellationToken)
Adds a new contact to the history/favorites. Returns the rank of the new history item. If the contact already existed in the history, it isn't added but the rank is updated.
Declaration
Task<int> AddToFavoritesAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contactId | The contact id |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskint | The rank of the history item |
GetContactPhonesAsync(int, CancellationToken)
Returns an array of phone list items for all the persons belonging to a contact (company). The in-parameter must be a valid contact-id.
Declaration
Task<PhoneListItem[]> GetContactPhonesAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contactId | The contact id |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListItem | The contacts phone list. |
GetDepartmentPhonesAsync(int, CancellationToken)
Returns an array of phone list items with the in-parameter as restriction. The in-parameter must be a valid department id (UserGroupId).
Declaration
Task<PhoneListItem[]> GetDepartmentPhonesAsync(int departmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | departmentId | The department to get the phone list for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListItem | The department phone list |
GetFavoritesPhonesAsync(CancellationToken)
Returns an array of phone list items with the Contacts in the users favorites dropdown list.
Declaration
Task<PhoneListItem[]> GetFavoritesPhonesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListItem | The favorite contact phone list |
GetPreferencesAsync(CancellationToken)
Getting Phone List Preferences from the CRM 5 user preferences
Declaration
Task<PhoneListPreferences> GetPreferencesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListPreferences | The Phone List Preferences |
SearchAsync(string, CancellationToken)
Searching the phone list. Using default search preferences or the preferences already set by the PhoneListPreferences Service
Declaration
Task<PhoneListItem[]> SearchAsync(string searchString, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | searchString | The search string |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListItem | The resulting phone list |
SearchWithPreferencesAsync(string, PhoneListPreferences, CancellationToken)
Searching the phone list. Search is based on the supplied preferences.
Declaration
Task<PhoneListItem[]> SearchWithPreferencesAsync(string searchString, PhoneListPreferences preferences, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | searchString | The search string. |
| PhoneListPreferences | preferences | The search preferences |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskPhoneListItem | The resulting phone list. |
SetPreferencesAsync(PhoneListPreferences, CancellationToken)
Setting Phone List Preferences to the CRM 5 user preferences
Declaration
Task SetPreferencesAsync(PhoneListPreferences preferences, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PhoneListPreferences | preferences | The preference that is set as user preferences |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |