SignalR Connections
SignalR Groups
The DataSync API uses SignalR groups for targeted notifications:
| Group Name |
Description |
all |
All connected clients receive all feed updates |
hospital-{id} |
Clients subscribed to specific hospital's data |
user-{id} |
Clients subscribed to specific user's data |
feed-{name} |
Clients interested in specific feed updates only |
Hub Endpoint
| Endpoint |
URL |
| SyncHub |
https://syncapi.opcommservice.com/hubs/sync |
Client Methods
| Method |
Parameters |
Description |
OnFeedChanged |
FeedChangedNotification |
Received when a feed has new changes |
OnFeedsStatus |
List<FeedVersionInfo> |
Periodic broadcast of all feed versions |
Subscribe |
string groupName |
Join a notification group |
Unsubscribe |
string groupName |
Leave a notification group |
GetVersions |
- |
Request current versions of all feeds |
Connection Example (C#)
var connection = new HubConnectionBuilder()
.WithUrl("https://syncapi.opcommservice.com/hubs/sync", options =>
{
options.AccessTokenProvider = () => Task.FromResult(accessToken);
})
.WithAutomaticReconnect()
.Build();
connection.On<FeedChangedNotification>("OnFeedChanged", notification =>
{
Console.WriteLine($"Feed {notification.FeedName} updated to v{notification.Version}");
});
await connection.StartAsync();
await connection.InvokeAsync("Subscribe", "all");