Skip to content
Start here

Fetch livestream session details using a session ID

client.RealtimeKit.Livestreams.GetLivestreamSessionsForSession(ctx, appID, sessionID, params) (*LivestreamGetLivestreamSessionsForSessionResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/sessions/{session_id}/livestream-sessions

Returns livestream session details for the given session ID. Retreive the session ID using the Fetch all sessions of an App API.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

sessionID string
formatuuid
params LivestreamGetLivestreamSessionsForSessionParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
PageNo param.Field[float64]Optional

Query param: The page number from which you want your page search results to be displayed.

PerPage param.Field[float64]Optional

Query param: Number of results per page.

ReturnsExpand Collapse
type LivestreamGetLivestreamSessionsForSessionResponse struct{…}
Data LivestreamGetLivestreamSessionsForSessionResponseData
Data []LivestreamGetLivestreamSessionsForSessionResponseDataData
ID string

ID of the livestream session.

formatuuid
CreatedAt Time

Timestamp the livestream session was created at, in ISO format.

formatdate-time
ErrMessage string

Error message, if the livestream session failed.

IngestSeconds float64

The time duration for which the input was given or the meeting was streamed.

InvokedTime Time

Timestamp the livestream session was invoked at, in ISO format.

formatdate-time
LivestreamID string

ID of the livestream.

formatuuid
StartedTime Time

Timestamp the livestream session started at, in ISO format.

formatdate-time
StoppedTime Time

Timestamp the livestream session stopped at, in ISO format.

formatdate-time
UpdatedAt Time

Timestamp the livestream session was last updated at, in ISO format.

formatdate-time
ViewerSeconds float64

The total view time for which the viewers watched the stream.

Paging LivestreamGetLivestreamSessionsForSessionResponseDataPaging
EndOffset float64
StartOffset float64
TotalCount float64
minimum0
Success bool

Fetch livestream session details using a session ID

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Livestreams.GetLivestreamSessionsForSession(
    context.TODO(),
    "14a396e7-ca44-4937-bf1f-050a69118543",
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    realtime_kit.LivestreamGetLivestreamSessionsForSessionParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "data": [
      {
        "created_at": "2023-07-15T07:08:40.742Z",
        "err_message": null,
        "id": "cf55a850-c3fd-46b5-b5d2-25b3b9aa1686",
        "ingest_seconds": 600,
        "invoked_time": "2023-07-15T07:08:26.634Z",
        "livestream_id": "b60ef3da-fbbb-441b-9168-8235b0035248",
        "started_time": "2023-07-15T07:08:39Z",
        "stopped_time": "2023-07-15T07:18:39Z",
        "updated_at": "2023-07-15T07:18:40.742Z",
        "viewer_seconds": 1200
      }
    ],
    "paging": {
      "end_offset": 1,
      "start_offset": 1,
      "total_count": 1
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "data": [
      {
        "created_at": "2023-07-15T07:08:40.742Z",
        "err_message": null,
        "id": "cf55a850-c3fd-46b5-b5d2-25b3b9aa1686",
        "ingest_seconds": 600,
        "invoked_time": "2023-07-15T07:08:26.634Z",
        "livestream_id": "b60ef3da-fbbb-441b-9168-8235b0035248",
        "started_time": "2023-07-15T07:08:39Z",
        "stopped_time": "2023-07-15T07:18:39Z",
        "updated_at": "2023-07-15T07:18:40.742Z",
        "viewer_seconds": 1200
      }
    ],
    "paging": {
      "end_offset": 1,
      "start_offset": 1,
      "total_count": 1
    }
  },
  "success": true
}