Getting Oracle Radio WebSocket Presence
Send a GET_PRESENCE message to get one Radio user's presence or the online users visible in the connection's Identity Domain.
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 | The current WebSocket message contract doesn't specify an operation-specific Radio permission. |
| Visibility | The service limits presence details to the authenticated Radio user's Identity Domain. Presence details for users outside that domain aren't returned. When a supplied userId doesn't resolve to a visible record, the PRESENCE response can echo the requested identifier with status set to offline and omit the presence details. |
| Session state | The WebSocket connection must be open and associated with an enabled Radio user. |
Request
Send the GET_PRESENCE message as a JSON text message.
| Name | Data type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
type | string | Yes | None | Must be GET_PRESENCE. | Identifies the presence query. |
userId | string | No | None | Radio user identifier. | User whose presence to get. Omit this parameter to list online users in the authenticated user's Identity Domain. |
{
"type": "GET_PRESENCE",
"userId": "u-12345"
}
Responses
The following table lists the messages the client can receive and explains their purpose.
| Message type | Kind | Description |
|---|---|---|
PRESENCE | Direct response | Returns presence for the supplied userId. If no visible record is found, the response identifies that user as offline without the optional details. |
PRESENCE_LIST | Direct response | When userId is omitted, returns the online users in the authenticated user's Identity Domain. |
ERROR | Error | Indicates that the request is invalid or couldn't be processed. |
PRESENCE 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 PRESENCE. |
userId | string | Yes | Radio user identifier. |
status | string | Yes | Presence status: online, offline, or away. |
username | string | Conditional | Username. Required when the response includes the known-user detail set. |
domain | string | Conditional | Identity Domain. Required when the response includes the known-user detail set. |
channel | string | No | A representative current channel, not all live memberships. Omitted when unavailable. Use channel users to check presence on a particular channel. |
device | string | No | Device value. Omitted when unavailable. |
lastSeen | string | No | ISO 8601 date and time value. Omitted when unavailable. |
metadata | object | Conditional | Additional presence properties returned with the known-user detail set. The schema doesn't define individual keys. |
{
"type": "PRESENCE",
"userId": "u-12345",
"username": "dispatcher1",
"domain": "acme",
"status": "online",
"channel": "operations",
"device": "console",
"lastSeen": "2024-01-15T10:30:00Z",
"metadata": {}
}
PRESENCE_LIST 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 PRESENCE_LIST. |
users | array of objects | Yes | Online users in the authenticated user's Identity Domain. |
users[].userId | string | Yes | Radio user identifier. |
users[].username | string | Yes | Username. |
users[].domain | string | Yes | Identity Domain. |
users[].status | string | Yes | Presence status: online, offline, or away. |
users[].channel | string | No | A representative current channel, not all live memberships. Omitted when unavailable. |
users[].device | string | No | Device value. Omitted when unavailable. |
users[].lastSeen | string | No | ISO 8601 date and time value. Omitted when unavailable. |
users[].metadata | object | Yes | Additional presence properties. The schema doesn't define individual keys. |
count | integer | Yes | Number of users in users. |
domain | string | No | Identity Domain that scopes the result. |
timestamp | string | No | Server date and time in ISO 8601 format. |
{
"type": "PRESENCE_LIST",
"users": [
{
"userId": "u-12345",
"username": "dispatcher1",
"domain": "acme",
"status": "online",
"channel": "operations",
"device": "console",
"lastSeen": "2024-01-15T10:30:00Z",
"metadata": {}
}
],
"count": 1,
"domain": "acme",
"timestamp": "2024-01-15T10:30:00Z"
}