Workflow: Sending Text Messages by Using the Oracle Radio WebSocket API
Send normal or critical text to a subscribed Radio channel and process confirmation, delivery, and denial results.
Before You Begin
Open an authenticated WebSocket connection. Follow Subscribing to an Oracle Radio WebSocket Channel, and verify the target channel's live subscription. A normal message requires radio.message.send and channel message access. A critical message also requires radio.message.critical and critical-message access to the channel.
Send a Normal Message
-
Follow Sending an Oracle Radio WebSocket Text Message to send
TEXT_MESSAGEwithcriticalset tofalse.{ "type": "TEXT_MESSAGE", "channel": "operations", "text": "All units stand by for briefing at 1400", "critical": false, "clientMessageId": "normal-message-123" } -
Wait for
TEXT_MESSAGE_SENTorERRORon the initiating connection. Match theclientMessageIdto the pending request. For success, confirm thechannelandcriticalvalues, and recordrecipientCountwhen it is present. An error for one identifier doesn't reject other pending messages on the same channel. -
On eligible other connections subscribed to the channel, process
TEXT_MESSAGE_RECEIVED. Do not wait for the initiating connection to receive its own delivery event.
Send a Critical Message
-
Verify that the user has the additional critical-message permission and channel access described in Sending an Oracle Radio WebSocket Text Message.
-
Follow Sending an Oracle Radio WebSocket Text Message to send
TEXT_MESSAGEwithcriticalset totrue.{ "type": "TEXT_MESSAGE", "channel": "operations", "text": "Evacuate the east entrance immediately", "critical": true, "clientMessageId": "critical-message-123" } -
Match
TEXT_MESSAGE_SENTorERRORto this request'sclientMessageId. A successful response hascriticalset totrue. Eligible other connections receiveTEXT_MESSAGE_RECEIVEDwith the critical indicator.
Handle Denials and Errors
Use the following guidance to handle denials and errors during this workflow.
| Result | Client action |
|---|---|
ERROR with NotAuthorizedOrNotFound | Do not report the correlated message as sent. The response doesn't disclose whether permissions, channel access, membership, or resource absence caused the failure. Verify the target and subscription, and have an authorized administrator review permissions. Don't downgrade a critical message automatically. |
Validation ERROR | Correct the message parameters. After correcting a confirmed rejection, use a new identifier for a deliberate new attempt. Reusing the old identifier can replay the cached error even when the input changes. |
Internal ERROR, WebSocket disconnect, or no terminal response | Treat delivery as indeterminate. If retrying the unchanged request, retain its original clientMessageId. A cached result can replay without another send, but no fixed retry-protection period or guarantee across reconnects or service restarts is established. Don't automatically use a new identifier or repeat a request that had no identifier. Follow the recovery procedure if disconnected. |
A cached rejection can replay even after access is corrected. Use a new identifier only for a deliberate new attempt after a confirmed rejection, not to bypass an uncertain delivery result. For further checks, see message troubleshooting.