<a id=“SuperOffice_WebApi_Agents_PocketAgent”></a> Class PocketAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Agent with Pocket specific functionality
Inheritance
object ← AgentBase ← PocketAgentImplements
IPocketAgent, 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 (PocketAgent agent = new PocketAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
<a id=“SuperOffice_WebApi_Agents_PocketAgent__ctor_System_Net_Http_HttpClient_”></a> PocketAgent(HttpClient)
Constructor: Agent with Pocket specific functionalityParameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
<a id=“SuperOffice_WebApi_Agents_PocketAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> PocketAgent(WebApiOptions, HttpClient)
Constructor: Agent with Pocket specific functionalityParameters
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_PocketAgent_GetCallerIDsFromSelectionAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetCallerIDsFromSelectionAsync(int, string, RequestOptions)
Get caller ids from a selection. Queries the shadow selection of persons and companies, so selections of any kind can be usedParameters
selectionId int
Id of selection to get caller ids from
lastHash string
Hash for the previous call, used for checking if the same set of caller ids was sent in an earlier call, and returning null in that case
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CallerIDCollection> Collection of caller IDs, containing the hash of the caller ids<a id=“SuperOffice_WebApi_Agents_PocketAgent_GetMyCallerIDsAsync_System_String_System_DateTime_System_DateTime_SuperOffice_WebApi_RequestOptions_”></a> GetMyCallerIDsAsync(string, DateTime, DateTime, RequestOptions)
Get caller ids that the current principal might be interested in (phone numbers of related persons in sales and appointments created/owned/touched by ourselves or colleagues in our primary groupParameters
lastHash string
Hash for the previous call, used for checking if the same set of caller ids was sent in a previous call, and returning null in that case
minDate DateTime
Only check activities after this date
maxDate DateTime
Only check activities before this date
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CallerIDCollection> Collection of caller IDs, containing the hash of the caller ids<a id=“SuperOffice_WebApi_Agents_PocketAgent_GetPocketStartupDataAsync_System_String___System_DateTime_SuperOffice_WebApi_RequestOptions_”></a> GetPocketStartupDataAsync(string[], DateTime, RequestOptions)
Parameters
tables string[]
Tables to check for license
currentClientTime DateTime
Current time on the client, used for overdue sale lookup having correct timezone relative to client
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PocketStartupData> Startup data for pocket<a id=“SuperOffice_WebApi_Agents_PocketAgent_GetPushNotificationTagsForDeviceAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetPushNotificationTagsForDeviceAsync(string, RequestOptions)
Retrieve current tag value for a deviceParameters
deviceIdentifier string
The unique identifier of this device
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> A comma separated list of events this device should receive push events for<a id=“SuperOffice_WebApi_Agents_PocketAgent_GetRegisteredDevicesAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetRegisteredDevicesAsync(int, RequestOptions)
Retrieve all registered devices for an associateParameters
associateId int
The user to get devices for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PocketDeviceInfo[]><a id=“SuperOffice_WebApi_Agents_PocketAgent_NotificationHandledAsync_SuperOffice_WebApi_Data_NotificationEventType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> NotificationHandledAsync(NotificationEventType, int, RequestOptions)
Mark a notification as handled, so it can be cleaned up on other clients that have received the notificationParameters
notificationEventType NotificationEventType
Type of notification
id int
Id of entity to notify about
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_NotificationsHandledAsync_SuperOffice_WebApi_Data_NotificationEvent___SuperOffice_WebApi_RequestOptions_”></a> NotificationsHandledAsync(NotificationEvent[], RequestOptions)
Mark a set of notifications as handled, so they can be cleaned up on other clients that have received the notificationParameters
notificationEvents NotificationEvent[]
List of notifications to mark as handled
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_NotifyUsersAsync_SuperOffice_WebApi_Data_NotificationEventType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> NotifyUsersAsync(NotificationEventType, int, RequestOptions)
Notify users about a new or changed entityParameters
notificationEventType NotificationEventType
Type of notification
id int
Id of entity to notify about
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_RegisterDeviceForPushNotificationAsync_SuperOffice_WebApi_Data_PocketDeviceInfo_SuperOffice_WebApi_RequestOptions_”></a> RegisterDeviceForPushNotificationAsync(PocketDeviceInfo, RequestOptions)
Register a device that should receive push notifications when notable events occourParameters
deviceInfo PocketDeviceInfo
Properties for the device to register
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_RunAppointmentAlarmBrokerAsync_SuperOffice_WebApi_RequestOptions_”></a> RunAppointmentAlarmBrokerAsync(RequestOptions)
Execute the AppointmentAlarmBroker onceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_SendPushNotificationAsync_System_Int32___SuperOffice_WebApi_Data_PocketNotificationMessage_SuperOffice_WebApi_RequestOptions_”></a> SendPushNotificationAsync(int[], PocketNotificationMessage, RequestOptions)
Send a push notification to one or more associatesParameters
associateIds int[]
The associates to send the push notification message to
message PocketNotificationMessage
The message to send
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_SetPushNotificationTagsForDeviceAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> SetPushNotificationTagsForDeviceAsync(string, string, RequestOptions)
Specify what kind of notification events a device should receive push notifications forParameters
deviceIdentifier string
The unique identifier for a device
tags string
A comma separated list of events this device should receive push events for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_PocketAgent_SetPushNotificationTagsForUserAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SetPushNotificationTagsForUserAsync(int, string, RequestOptions)
Specify what kind of notification events a user should receive push notifications for. This will update all registerred devices for this user.Parameters
associateId int
The associate to set tags for
tags string
A comma separated list of events the associate should receive push events for
requestOptions RequestOptions
Override language/culture codes on this request.