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.

RequirementValue
AuthenticationComplete the supported authentication path for the client before sending this operation. See authentication.
Radio permissionThe current WebSocket message contract doesn't specify an operation-specific Radio permission.
VisibilityThe 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 stateThe WebSocket connection must be open and associated with an enabled Radio user.

Request

Send the GET_PRESENCE message as a JSON text message.

NameData typeRequiredDefaultConstraintsDescription
typestringYesNoneMust be GET_PRESENCE.Identifies the presence query.
userIdstringNoNoneRadio 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 typeKindDescription
PRESENCEDirect responseReturns presence for the supplied userId. If no visible record is found, the response identifies that user as offline without the optional details.
PRESENCE_LISTDirect responseWhen userId is omitted, returns the online users in the authenticated user's Identity Domain.
ERRORErrorIndicates 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.

NameData typeRequiredDescription
typestringYesResponse type. The value is PRESENCE.
userIdstringYesRadio user identifier.
statusstringYesPresence status: online, offline, or away.
usernamestringConditionalUsername. Required when the response includes the known-user detail set.
domainstringConditionalIdentity Domain. Required when the response includes the known-user detail set.
channelstringNoA representative current channel, not all live memberships. Omitted when unavailable. Use channel users to check presence on a particular channel.
devicestringNoDevice value. Omitted when unavailable.
lastSeenstringNoISO 8601 date and time value. Omitted when unavailable.
metadataobjectConditionalAdditional 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.

NameData typeRequiredDescription
typestringYesResponse type. The value is PRESENCE_LIST.
usersarray of objectsYesOnline users in the authenticated user's Identity Domain.
users[].userIdstringYesRadio user identifier.
users[].usernamestringYesUsername.
users[].domainstringYesIdentity Domain.
users[].statusstringYesPresence status: online, offline, or away.
users[].channelstringNoA representative current channel, not all live memberships. Omitted when unavailable.
users[].devicestringNoDevice value. Omitted when unavailable.
users[].lastSeenstringNoISO 8601 date and time value. Omitted when unavailable.
users[].metadataobjectYesAdditional presence properties. The schema doesn't define individual keys.
countintegerYesNumber of users in users.
domainstringNoIdentity Domain that scopes the result.
timestampstringNoServer 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"
}