Class PhoneListAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Collection of all services for searching for person or contact (company) phone numbers.
Inheritance
object ← AgentBase ← PhoneListAgentImplements
IPhoneListAgent, IAgentBase, IDisposableInherited 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>(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 (PhoneListAgent agent = new PhoneListAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
PhoneListAgent(HttpClient)
Constructor: Collection of all services for searching for person or contact (company) phone numbers.Parameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
PhoneListAgent(WebApiOptions, HttpClient)
Constructor: Collection of all services for searching for person or contact (company) phone numbers.Parameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
AddToFavoritesAsync(int, RequestOptions)
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.Parameters
contactId int
The contact id
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> The rank of the history itemGetContactPhonesAsync(int, RequestOptions)
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.Parameters
contactId int
The contact id
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListItem[]> The contacts phone list.GetDepartmentPhonesAsync(int, RequestOptions)
Returns an array of phone list items with the in-parameter as restriction. The in-parameter must be a valid department id (UserGroupId).Parameters
departmentId int
The department to get the phone list for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListItem[]> The department phone listGetFavoritesPhonesAsync(RequestOptions)
Returns an array of phone list items with the Contacts in the users favorites dropdown list.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListItem[]> The favorite contact phone listGetPreferencesAsync(RequestOptions)
Getting Phone List Preferences from the CRM 5 user preferencesParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListPreferences> The Phone List PreferencesSearchAsync(string, RequestOptions)
Searching the phone list. Using default search preferences or the preferences already set by the PhoneListPreferences ServiceParameters
searchString string
The search string
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListItem[]> The resulting phone listSearchWithPreferencesAsync(string, PhoneListPreferences, RequestOptions)
Searching the phone list. Search is based on the supplied preferences.Parameters
searchString string
The search string.
preferences PhoneListPreferences
The search preferences
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PhoneListItem[]> The resulting phone list.SetPreferencesAsync(PhoneListPreferences, RequestOptions)
Setting Phone List Preferences to the CRM 5 user preferencesParameters
preferences PhoneListPreferences
The preference that is set as user preferences
requestOptions RequestOptions
Override language/culture codes on this request.