Workflow: Managing Another User's Oracle Radio WebSocket Channel Subscriptions

Subscribe or unsubscribe another connected Radio user and verify the requester result and notifications sent to the user's affected sessions.

Before You Begin

Open an authenticated WebSocket connection for a user with radio.user.subscriptions.manage. The target username must identify a currently connected Radio user in the same Identity Domain. The service applies each operation to every currently connected WebSocket session for that target user. These operations change live channel subscriptions; they do not grant or remove channel access.

Subscribe Another User

  1. Follow Subscribing an Oracle Radio User to WebSocket Channels to send SUBSCRIBE_USER. Use targetUser for new integrations and supply channels for one or more channel names.

    {
      "type": "SUBSCRIBE_USER",
      "targetUser": "field-unit-5",
      "channels": ["operations", "emergency"]
    }
  2. Wait for USER_SUBSCRIBED on the requester's connection. Inspect each entry in channels, and treat only an entry with subscribed set to true as a successful live subscription. Inspect clientsSubscribed to determine how many of the target user's connected sessions are represented. If the count is absent, do not assume that only one session was affected.

  3. On each target-user session whose membership changes, process the SUBSCRIBED_BY notification and identify the requester from subscribedBy.

Unsubscribe Another User

  1. Follow Unsubscribing an Oracle Radio User from WebSocket Channels to send UNSUBSCRIBE_USER.

    {
      "type": "UNSUBSCRIBE_USER",
      "targetUser": "field-unit-5",
      "channels": ["emergency"]
    }
  2. Wait for USER_UNSUBSCRIBED on the requester's connection. Inspect each channel result and its clientsUnsubscribed count when present. A result with unsubscribed set to false can include a reason.

  3. On each target-user session whose membership changes, process the UNSUBSCRIBED_BY notification and identify the requester from unsubscribedBy.

Handle Denials and Connection Changes

  • If the service returns ERROR, correct the missing selector, management permission, target-user connection, or other reported problem before retrying.
  • If the target user disconnects, do not assume that the requested change applies to a future connection. Repeat the operation only after the user is connected and the requester still intends the change.
  • Use Radio channel-access administration when the user needs an ACL grant. SUBSCRIBE_USER and UNSUBSCRIBE_USER do not change ACLs.