Unsubscribing from an Oracle Radio WebSocket Channel

Send an UNSUBSCRIBE message to remove the current Radio WebSocket connection from one or more channels.

Permissions and Prerequisites

The following permissions and prerequisites apply to this operation.

RequirementValue
AuthenticationComplete the supported authentication path for the client before sending this operation. See authentication.
Radio permissionNo operation-specific Radio permission is defined for this message.
Channel accessThe operation applies to the current connection's live memberships. A user can't unsubscribe from the user's personal channel.
Session stateThe WebSocket connection must be open. The connection can request only its own unsubscription.
Note

The contract doesn't define whether this operation changes a separately saved subscription or how subscription state is restored after reconnecting.

Request

Send the UNSUBSCRIBE message as a JSON text message. Use channels for one or more channel names.

NameData typeRequiredDefaultConstraintsDescription
typestringYesNoneMust be UNSUBSCRIBE.Identifies the channel-unsubscribe operation.
channelstringNoNoneSingle channel name.Channel to leave when requesting one channel.
channelsarray of stringsNoNoneChannel names.Channels to leave.
Note

The contract defines both channel and channels as optional and doesn't define behavior when both or neither property is supplied. For a portable preview request, supply exactly one of these properties. Prefer channels.
{
  "type": "UNSUBSCRIBE",
  "channels": ["operations"]
}

Responses

The following table lists the messages the client can receive and explains their purpose.

Message typeKindDescription
UNSUBSCRIBEDDirect responseReports the result for each requested channel. A result can explain why a channel wasn't left.
ERRORDenial or errorIndicates a missing channel list, identity-domain failure, invalid request, or processing failure.

UNSUBSCRIBED Response

The following table describes the response properties, their data types, and whether they are required.

NameData typeRequiredDescription
typestringYesResponse type. The value is UNSUBSCRIBED.
channelsobjectYesResult keyed by requested channel name.
channels.*.unsubscribedbooleanNoWhether the connection left the channel.
channels.*.deniedbooleanNoWhether the request was denied.
channels.*.reasonstringNoReason the connection didn't leave the channel.
channelstringNoChannel for a single-channel request.
unsubscribedbooleanNoResult for a single-channel request.
reasonstringNoFailure reason for a single-channel request.
warningstringNoWarning when some requested channels couldn't be left.
{
  "type": "UNSUBSCRIBED",
  "channels": {
    "operations": {
      "unsubscribed": true
    }
  },
  "channel": "operations",
  "unsubscribed": true
}