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
GetCallerIDsFromSelection(Int32, String)
Get caller ids from a selection. Queries the shadow selection of persons and companies, so selections of any kind can be used
Declaration
CallerIDCollection GetCallerIDsFromSelection(int selectionId, string lastHash)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
CallerIDCollection | Collection of caller IDs, containing the hash of the caller ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
GetMyCallerIDs(String, DateTime, DateTime)
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
CallerIDCollection GetMyCallerIDs(string lastHash, DateTime minDate, DateTime maxDate)
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 |
Returns
Type | Description |
---|---|
CallerIDCollection | Collection of caller IDs, containing the hash of the caller ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
GetPocketStartupData(String[], DateTime)
Interface for the Pocket Agent Agent with Pocket specific functionality
Declaration
PocketStartupData GetPocketStartupData(string[] tables, DateTime currentClientTime)
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 |
Returns
Type | Description |
---|---|
PocketStartupData | Startup data for pocket |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
GetPushNotificationTagsForDevice(String)
Retrieve current tag value for a device
Declaration
string GetPushNotificationTagsForDevice(string deviceIdentifier)
Parameters
Type | Name | Description |
---|---|---|
String | deviceIdentifier | The unique identifier of this device |
Returns
Type | Description |
---|---|
String | A comma separated list of events this device should receive push events for |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
GetRegisteredDevices(Int32)
Retrieve all registered devices for an associate
Declaration
PocketDeviceInfo[] GetRegisteredDevices(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | The user to get devices for |
Returns
Type | Description |
---|---|
PocketDeviceInfo[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
NotificationHandled(NotificationEventType, Int32)
Mark a notification as handled, so it can be cleaned up on other clients that have received the notification
Declaration
void NotificationHandled(NotificationEventType notificationEventType, int id)
Parameters
Type | Name | Description |
---|---|---|
NotificationEventType | notificationEventType | Type of notification |
Int32 | id | Id of entity to notify about |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
NotificationsHandled(NotificationEvent[])
Mark a set of notifications as handled, so they can be cleaned up on other clients that have received the notification
Declaration
void NotificationsHandled(NotificationEvent[] notificationEvents)
Parameters
Type | Name | Description |
---|---|---|
NotificationEvent[] | notificationEvents | List of notifications to mark as handled |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
NotifyUsers(NotificationEventType, Int32)
Notify users about a new or changed entity
Declaration
void NotifyUsers(NotificationEventType notificationEventType, int id)
Parameters
Type | Name | Description |
---|---|---|
NotificationEventType | notificationEventType | Type of notification |
Int32 | id | Id of entity to notify about |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
RegisterDeviceForPushNotification(PocketDeviceInfo)
Register a device that should receive push notifications when notable events occour
Declaration
void RegisterDeviceForPushNotification(PocketDeviceInfo deviceInfo)
Parameters
Type | Name | Description |
---|---|---|
PocketDeviceInfo | deviceInfo | Properties for the device to register |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
RunAppointmentAlarmBroker()
Execute the AppointmentAlarmBroker once
Declaration
void RunAppointmentAlarmBroker()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
SendPushNotification(Int32[], PocketNotificationMessage)
Send a push notification to one or more associates
Declaration
void SendPushNotification(int[] associateIds, PocketNotificationMessage message)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | associateIds | The associates to send the push notification message to |
PocketNotificationMessage | message | The message to send |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
SetPushNotificationTagsForDevice(String, String)
Specify what kind of notification events a device should receive push notifications for
Declaration
void SetPushNotificationTagsForDevice(string deviceIdentifier, string tags)
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 |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}
SetPushNotificationTagsForUser(Int32, String)
Specify what kind of notification events a user should receive push notifications for. This will update all registerred devices for this user.
Declaration
void SetPushNotificationTagsForUser(int associateId, string tags)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | The associate to set tags for |
String | tags | A comma separated list of events the associate should receive push events for |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (PocketAgent agent = new PocketAgent())
{
// call methods on agent here...
}
}