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.
| Requirement | Value |
|---|---|
| Authentication | Complete the supported authentication path for the client before sending this operation. See authentication. |
| Radio permission | radio.channel.create |
| Channel access | The 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 state | The WebSocket connection must be open and associated with an enabled Radio user. |
Request
Send the CREATE_CHANNEL message as a JSON text message.
| Name | Data type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
type | string | Yes | None | Must be CREATE_CHANNEL. | Identifies the channel-create operation. |
channel | string | Yes | None | Maximum 64 characters; use alphanumeric characters, hyphens, and underscores. | Name of the channel to create. |
mode | string | No | normal | normal or private. | In normal mode, all subscribers receive broadcasts. In private mode, only the owner receives broadcasts from other users. |
user | string | No | None | Display name. | Display name of the creator. |
domain | string | No | User's domain | Domain 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 type | Kind | Description |
|---|---|---|
CHANNEL_CREATED | Direct response | Confirms creation and returns the channel's mode, owner, and domain. |
ERROR | Denial or error | Indicates 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.
| Name | Data type | Required | Description |
|---|---|---|---|
type | string | Yes | Response type. The value is CHANNEL_CREATED. |
channel | string | Yes | Created channel name. |
mode | string | Yes | Created channel mode. |
owner | string | No | Channel owner. |
domain | string | No | Channel domain. |
{
"type": "CHANNEL_CREATED",
"channel": "team-alpha",
"mode": "normal",
"owner": "admin",
"domain": "acme"
}