Creating an Oracle Radio WebSocket Channel

Send a CREATE_CHANNEL message to create a Radio channel and join the connection to it.

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 permissionradio.channel.create
Channel accessThe contract creates the channel in the user's domain or in the domain specified by domain. The creator becomes the owner and the current connection is subscribed to the channel.
Session stateThe WebSocket connection must be open and associated with an enabled Radio user.

Request

Send the CREATE_CHANNEL message as a JSON text message.

NameData typeRequiredDefaultConstraintsDescription
typestringYesNoneMust be CREATE_CHANNEL.Identifies the channel-create operation.
channelstringYesNoneMaximum 64 characters; use alphanumeric characters, hyphens, and underscores.Name of the channel to create.
modestringNonormalnormal or private.In normal mode, all subscribers receive broadcasts. In private mode, only the owner receives broadcasts from other users.
userstringNoNoneDisplay name.Display name of the creator.
domainstringNoUser's domainDomain name.Domain in which to create the channel.
{
  "type": "CREATE_CHANNEL",
  "channel": "team-alpha",
  "mode": "normal",
  "user": "admin",
  "domain": "acme"
}

Responses

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

Message typeKindDescription
CHANNEL_CREATEDDirect responseConfirms creation and returns the channel's mode, owner, and domain.
ERRORDenial or errorIndicates insufficient permission, an invalid request, a naming or mode constraint failure, an existing-channel conflict, or another processing failure.

CHANNEL_CREATED Response

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

NameData typeRequiredDescription
typestringYesResponse type. The value is CHANNEL_CREATED.
channelstringYesCreated channel name.
modestringYesCreated channel mode.
ownerstringNoChannel owner.
domainstringNoChannel domain.
{
  "type": "CHANNEL_CREATED",
  "channel": "team-alpha",
  "mode": "normal",
  "owner": "admin",
  "domain": "acme"
}