Sessions
Channel Session
End session
- DELETE /channels/(string: uuid)/session/(string: sessionId)
Ends a session in the specified channel, disconnecting all users and terminating the session.
- Parameters:
uuid (string) – The ID of the channel whose session is to be ended.
sessionId (string) – [optional] If specified, only this session ID will be terminated. If a different session is active when this call is made, it will not be terminated. If this parameter is not included, the active session in the channel will be terminated.
Get session
- GET /sessions/(string: sessionId)
Get details about one specific session.
- Parameters:
sessionId (string) – Session identifier
- Query Parameters:
imgSize (string) – Optional parameter that defines which size of image will be returned
- Response JSON Object:
ended (option[long]) – Timestamp when session ended. If not provided, it means session is still ongoing.
name (string) – Name of this session
serviceMode (string) – Service mode of a channel, can be conference or panel
channel (string) – Channel unique identifier
participantsCount (int) – Number of participants in a session
clientId (string) – Client identifier that this session belongs to
hadRecording (boolean) – Did the session had a recording?
groupId (option[string]) – Optional group this session belongs to. This is arbitrary and can be used to somehow group sessions by some key
id (string) – Session unique identifier
started (option[long]) – Timestamp when session started
imageUrl (option[string]) – URL for image of this session
parentId (option[string]) – Optional id of parent session this session was created in (i.e. during Breakout Session flow)
created (long) – Timestamp when session was initialize on streaming server
Get session participants
- GET /sessions/(string: sessionId)/participants
Get list of users that participated in a given session.
- Parameters:
sessionId (string) – Session identifier
- Query Parameters:
imgSize (string) – Optional parameter that defines which size of image will be returned
- Response JSON Array of Objects:
id (long) – The user’s unique ID
handle (string) – The user’s handle
imageUrl (option[string]) – A url pointing to the user’s image
Get session recordings
- GET /sessions/(string: sessionId)/recordings
Get list of recording assets that were produced for the specified session.
- Parameters:
sessionId (string) – Session identifier
- Response JSON Array of Objects:
format (string) – Format of the file. I.e. CMS or MP4
streamUserId (option[long]) – [default: None] ID of an user that this asset belongs to. It makes sense only for individual streams
startTime (long)
size (option[long]) – [default: None] Size of asset in bytes
state (recordingassetstate.value) – State of this asset uploading process
url (option[string]) – [default: None] URL for this asset
relativePath (option[string]) – Path to this asset relative to recording root (when uploading to provider)
label (string) – Some description of this asset
endTime (option[long])
id (string) – The ID of this asset
userId (option[long]) – [default: None] ID of user that has the uploaded file (the user who setup recording details for channel and received the file on his provider account.
kind (recordingassetkind.value) – What kind of asset type is it (audio, video, other)
isIndividual (boolean) – Is this an individual stream from some user?
recordingId (string) – The ID of the recording
group (option[string]) – [default: None] To which group given asset belongs. The group is usually just a streamId from the CMS StartStream message but could also be used when we group two individual streams into one asset during recording (i.e. when a reconnection happens for a stream)
List historical channel participants
- GET /channels/(string: uuid)/participants
Allow to search through users that were in in the channel in the past. The list is order by session timestamp. Users that were recently in the channel are on the top of the list.
- Parameters:
uuid (string) – The channel ID
- Query Parameters:
search (string) – String to filter users by
offset (string) – Offset at which start looking for results in database. Needed for implementing pagination
limit (string) – Limit amount of results. Needed for implementing pagination
imgSize (string)
Response:
{ total: number results: list }
where total is a total amount of elements matching criteria results objects has following fields:
{ id: long // The user's unique ID handle: string // The user's handle imageUrl: option[string] // A url pointing to the user's image }
List sessions
- GET /sessions
List all sessions that match the specified criteria. Results are limited to channels in which the authentication credentials passed with this call have at least operator (“host”) privilege.
- Query Parameters:
channel (string) – Channel UUID - if provided, sessions will be filtered only scope of this channel
search (string) – String to filter channels by
limit (string) – Limit amount of results. Needed for implementing pagination
offset (string) – Offset at which start looking for results in database. Needed for implementing pagination
imgSize (string) – Optionally images size for channel images results
sort (string) – By what column sort results. Possible values: [“started”, “ended”, “name”, “presence”]. Default is “started”
order (string) – In which order sort results. Possible values: [“asc”, “desc”]. Default is “desc”
from (string) – Start timestamp in milliseconds - filter sessions where started is greater than this value
to (string) – End timestamp in milliseconds - filter sessions where started is less than this value
hasRecording (string) – Optional boolean to filter sessions by recording availability
Response:
{ total: number results: list }
where total is a total amount of elements matching criteria results objects has following fields:
{ ended: option[long] // Timestamp when session ended. If not provided, it means session is still ongoing. name: string // Name of this session serviceMode: string // Service mode of a channel, can be conference or panel channel: string // Channel unique identifier participantsCount: int // Number of participants in a session clientId: string // Client identifier that this session belongs to hadRecording: boolean // Did the session had a recording? groupId: option[string] // Optional group this session belongs to. This is arbitrary and can be used to somehow group sessions by some key id: string // Session unique identifier started: option[long] // Timestamp when session started imageUrl: option[string] // URL for image of this session parentId: option[string] // Optional id of parent session this session was created in (i.e. during Breakout Session flow) created: long // Timestamp when session was initialize on streaming server }
App Sessions
Associate user with app session
Get app session details
- GET /app_sessions/(string: appSessionId)
Return details about a specified App Session.
- Parameters:
appSessionId (string) – App Session Identifier
- Response JSON Object:
channels (seq[string]) – List of channels this app session is associated with.
clientId (string) – Client Identifier
url (string) – URL at which Application was running
users (seq[appsessionuser]) – List of IDs of users involved in this app session
id (string) – App Session Identifier
channelsSessions (seq[string]) – List of channel sessions this app session is associated with.
started (long) – UTC Timestamp in milliseconds when app session started
Get app session logs
Link channel session with app session
- POST /app_sessions/(string: appSession)/link/channel/session/(string: channelUuid)/(string: channelSession)
Method to link channel and channel session with given App Session
- Parameters:
appSession (string) – App Session identifier
channelUuid (string) – Channel Identifier
channelSession (string) – Channel Session Identifier. It’s options so only channel can be provided for linking
Query app sessions
- GET /app_sessions
Return a list of App Session IDs matching all specified criteria.
- Query Parameters:
offset (string) – [optional] Offset at which start looking for results in database. Needed for pagination.
limit (string) – [optional] Limit amount of results. Needed for pagination.
user (string) – [optional] Only include App Sessions related to the specified userId.
channelSession (string) – [optional] Only include App Sessions related to the specified channel session.
channel (string) – [optional] Only include App Sessions related to the specified channel.
url (string) – [optional] Only include App Sessions run from a URL that includes the specified substring.
startedBefore (string) – [optional] Only include app sessions started before this timestamp (UTC).
startedAfter (string) – [optional] Only include app sessions started after this timestamp (UTC).
Response:
{ total: number results: list }
where total is a total amount of elements matching criteria results objects has following fields:
{ channels: seq[string] // List of channels this app session is associated with. clientId: string // Client Identifier url: string // URL at which Application was running users: seq[appsessionuser] // List of IDs of users involved in this app session id: string // App Session Identifier channelsSessions: seq[string] // List of channel sessions this app session is associated with. started: long // UTC Timestamp in milliseconds when app session started }
Register new app session
- POST /app_sessions/new/(string: clientId)
An “App Session” refers to one unique instance of a horn client application such as the Horn Conference UI (or any custom client application) being run. This method registers a new App Session with the backend, and returns the UUID of newly registered App Session that should be used for further calls within this application session (like sending actual logs, linking user to this session etc).
- Parameters:
clientId (string) – Client Id associated with your application
- Request JSON Object:
started (long) – Timestamp in milliseconds when app session started
url (string) – URL at which the logs we’re captured
channel (option[string])
- Response JSON Object:
id (string) – App Session Identifier
Send logs to app session
- POST /app_sessions/(string: appSession)/logs
Method to send actual logs to given App Session
- Parameters:
appSession (string) – App Session Id (as returned by Register New App Session)
- Request JSON Object:
time (long) – When log happens
data (string) – Data for this log
index (option[long]) – Index of the log. Like Sequence Number. Each log for a given app session has a unique index