Show / Hide Table of Contents

Interface IPocketAgent

Interface for the Pocket Agent Agent with Pocket specific functionality

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Pocket Agent", "Interface for the Pocket Agent. Agent with Pocket specific functionality")]
public interface IPocketAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (PocketAgent agent = new PocketAgent())
   {
      // call methods on agent here...
   }
}

Methods

GetCallerIDsFromSelectionAsync(int, string, CancellationToken)

Get caller ids from a selection. Queries the shadow selection of persons and companies, so selections of any kind can be used

Declaration
Task<CallerIDCollection> GetCallerIDsFromSelectionAsync(int selectionId, string lastHash, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int selectionId

Id of selection to get caller ids from

string lastHash

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

CancellationToken cancellationToken
Returns
Type Description
Task<CallerIDCollection>

Collection of caller IDs, containing the hash of the caller ids

GetMyCallerIDsAsync(string, DateTime, DateTime, CancellationToken)

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 group

Declaration
Task<CallerIDCollection> GetMyCallerIDsAsync(string lastHash, DateTime minDate, DateTime maxDate, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string lastHash

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

DateTime minDate

Only check activities after this date

DateTime maxDate

Only check activities before this date

CancellationToken cancellationToken
Returns
Type Description
Task<CallerIDCollection>

Collection of caller IDs, containing the hash of the caller ids

GetPocketStartupDataAsync(string[], DateTime, CancellationToken)

Interface for the Pocket Agent Agent with Pocket specific functionality

Declaration
Task<PocketStartupData> GetPocketStartupDataAsync(string[] tables, DateTime currentClientTime, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string[] tables

Tables to check for license

DateTime currentClientTime

Current time on the client, used for overdue sale lookup having correct timezone relative to client

CancellationToken cancellationToken
Returns
Type Description
Task<PocketStartupData>

Startup data for pocket

GetPushNotificationTagsForDeviceAsync(string, CancellationToken)

Retrieve current tag value for a device

Declaration
Task<string> GetPushNotificationTagsForDeviceAsync(string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deviceIdentifier

The unique identifier of this device

CancellationToken cancellationToken
Returns
Type Description
Task<string>

A comma separated list of events this device should receive push events for

GetRegisteredDevicesAsync(int, CancellationToken)

Retrieve all registered devices for an associate

Declaration
Task<PocketDeviceInfo[]> GetRegisteredDevicesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

The user to get devices for

CancellationToken cancellationToken
Returns
Type Description
Task<PocketDeviceInfo[]>

NotificationHandledAsync(NotificationEventType, int, CancellationToken)

Mark a notification as handled, so it can be cleaned up on other clients that have received the notification

Declaration
Task NotificationHandledAsync(NotificationEventType notificationEventType, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NotificationEventType notificationEventType

Type of notification

int id

Id of entity to notify about

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

NotificationsHandledAsync(NotificationEvent[], CancellationToken)

Mark a set of notifications as handled, so they can be cleaned up on other clients that have received the notification

Declaration
Task NotificationsHandledAsync(NotificationEvent[] notificationEvents, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NotificationEvent[] notificationEvents

List of notifications to mark as handled

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

NotifyUsersAsync(NotificationEventType, int, CancellationToken)

Notify users about a new or changed entity

Declaration
Task NotifyUsersAsync(NotificationEventType notificationEventType, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NotificationEventType notificationEventType

Type of notification

int id

Id of entity to notify about

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

RegisterDeviceForPushNotificationAsync(PocketDeviceInfo, CancellationToken)

Register a device that should receive push notifications when notable events occour

Declaration
Task RegisterDeviceForPushNotificationAsync(PocketDeviceInfo deviceInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PocketDeviceInfo deviceInfo

Properties for the device to register

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

RunAppointmentAlarmBrokerAsync(CancellationToken)

Execute the AppointmentAlarmBroker once

Declaration
Task RunAppointmentAlarmBrokerAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

SendPushNotificationAsync(int[], PocketNotificationMessage, CancellationToken)

Send a push notification to one or more associates

Declaration
Task SendPushNotificationAsync(int[] associateIds, PocketNotificationMessage message, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] associateIds

The associates to send the push notification message to

PocketNotificationMessage message

The message to send

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

SetPushNotificationTagsForDeviceAsync(string, string, CancellationToken)

Specify what kind of notification events a device should receive push notifications for

Declaration
Task SetPushNotificationTagsForDeviceAsync(string deviceIdentifier, string tags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deviceIdentifier

The unique identifier for a device

string tags

A comma separated list of events this device should receive push events for

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

SetPushNotificationTagsForUserAsync(int, string, CancellationToken)

Specify what kind of notification events a user should receive push notifications for. This will update all registerred devices for this user.

Declaration
Task SetPushNotificationTagsForUserAsync(int associateId, string tags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

The associate to set tags for

string tags

A comma separated list of events the associate should receive push events for

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top