Skip to content
Start here

Fetch livestream session details using livestream session ID

client.RealtimeKit.Livestreams.GetLivestreamSessionDetailsForSessionID(ctx, appID, livestreamSessionID, query) (*LivestreamGetLivestreamSessionDetailsForSessionIDResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/livestreams/sessions/{livestream-session-id}

Returns livestream session details for the given livestream session ID. Retrieve the livestream_session_idusing the Fetch livestream session details using a session ID API.

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

maxLength32
livestreamSessionID string
query LivestreamGetLivestreamSessionDetailsForSessionIDParams
AccountID param.Field[string]

The account identifier tag.

maxLength32
ReturnsExpand Collapse
type LivestreamGetLivestreamSessionDetailsForSessionIDResponse struct{…}
Data LivestreamGetLivestreamSessionDetailsForSessionIDResponseDataOptional
ID stringOptional

The livestream ID.

CreatedAt TimeOptional

Timestamp the object was created at. The time is returned in ISO format.

formatdate-time
ErrMessage stringOptional

The server URL to which the RTMP encoder sends the video and audio data.

IngestSeconds int64Optional

Name of the livestream.

LivestreamID stringOptional
StartedTime stringOptional

Unique key for accessing each livestream.

StoppedTime stringOptional

The web address that viewers can use to watch the livestream.

UpdatedAt stringOptional

Timestamp the object was updated at. The time is returned in ISO format.

ViewerSeconds int64Optional

Specifies if the livestream was disabled.

Success boolOptional

Fetch livestream session details using livestream 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.GetLivestreamSessionDetailsForSessionID(
    context.TODO(),
    "app_id",
    "livestream-session-id",
    realtime_kit.LivestreamGetLivestreamSessionDetailsForSessionIDParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "id": "id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "err_message": "err_message",
    "ingest_seconds": 0,
    "livestream_id": "livestream_id",
    "started_time": "started_time",
    "stopped_time": "stopped_time",
    "updated_at": "updated_at",
    "viewer_seconds": 0
  },
  "success": true
}
Returns Examples
{
  "data": {
    "id": "id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "err_message": "err_message",
    "ingest_seconds": 0,
    "livestream_id": "livestream_id",
    "started_time": "started_time",
    "stopped_time": "stopped_time",
    "updated_at": "updated_at",
    "viewer_seconds": 0
  },
  "success": true
}