> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSPocketAgent

> Agent with Pocket specific functionality.

Agent with Pocket specific functionality.

## Constructors

### NSPocketAgent()

```crmscript theme={null}
NSPocketAgent
```

Agent with Pocket specific functionality.

## Methods

## GetPocketStartupData(String\[])

Returns start-up data for SuperOffice Pocket CRM

```crmscript theme={null}
NSPocketStartupData GetPocketStartupData(String[] tables, DateTime currentClientTime)
```

**Returns:** [CRMScript.NetServer.NSPocketStartupData](CRMScript.NetServer.NSPocketStartupData)

**Example:**

```crmscript theme={null}
NSPocketAgent agent;
String[] tables;
DateTime currentClientTime;
NSPocketStartupData res = agent.GetPocketStartupData(tables, currentClientTime);
```

## GetPushNotificationTagsForDevice(String)

Retrieves current tag value for a device

```crmscript theme={null}
String GetPushNotificationTagsForDevice(String deviceIdentifier)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

**Example:**

```crmscript theme={null}
NSPocketAgent agent;
String deviceIdentifier;
String res = agent.GetPushNotificationTagsForDevice(deviceIdentifier);
```

## GetRegisteredDevices(Integer)

Retrieves all registered devices for an associate

```crmscript theme={null}
NSPocketDeviceInfo[] GetRegisteredDevices(Integer associateId)
```

**Returns:** [CRMScript.NetServer.NSPocketDeviceInfo](CRMScript.NetServer.NSPocketDeviceInfo)\[]

## RegisterDeviceForPushNotification(NSPocketDeviceInfo)

Registers a device that should receive push notifications when notable events occur

```crmscript theme={null}
Void RegisterDeviceForPushNotification(NSPocketDeviceInfo deviceInfo)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## RunAppointmentAlarmBroker()

Executes the AppointmentAlarmBroker once

```crmscript theme={null}
Void RunAppointmentAlarmBroker()
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## SendPushNotification(Integer\[],PocketNotificationMessage)

Sends a push notification to one or more associates

```crmscript theme={null}
Void SendPushNotification(Integer[] associateIds, PocketNotificationMessage message)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## SetPushNotificationTagsForDevice(String,String)

```crmscript theme={null}
Void SetPushNotificationTagsForDevice(String deviceIdentifier, String tags)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## SetPushNotificationTagsForUser(Integer,String)

```crmscript theme={null}
Void SetPushNotificationTagsForUser(Integer associateId, String tags)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  This will update all registered devices for this user.
</Note>


## Related topics

- [SuperOffice.WebApi.Agents.PocketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PocketAgent.md)
- [SuperOffice.WebApi.Agents.IPocketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IPocketAgent.md)
- [Get Pocket Startup Data](/en/api/reference/restful/agent/pocket_agent/get-pocket-startup-data.md)
- [Pocket CRM configuration](/en/onsite/pocket-crm/configure.md)
- [Pocket template variables](/en/document/templates/variables/for-pocket.md)
- [SuperOffice.WebApi.Data.PocketDeviceInfo](/en/api/reference/webapi/SuperOffice.WebApi.Data.PocketDeviceInfo.md)
