Skip to content
Start here

Fetch details of peer

client.RealtimeKit.Sessions.GetParticipantDataFromPeerID(ctx, appID, peerID, params) (*SessionGetParticipantDataFromPeerIDResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/sessions/peer-report/{peer_id}

Returns details of the given peer ID along with call statistics for the given session ID.

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
peerID string
formatuuid
params SessionGetParticipantDataFromPeerIDParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32

Query param: Comma separated list of filters to apply. Note that there must be no spaces between the filters.

const SessionGetParticipantDataFromPeerIDParamsFiltersDeviceInfo SessionGetParticipantDataFromPeerIDParamsFilters = "device_info"
const SessionGetParticipantDataFromPeerIDParamsFiltersIPInformation SessionGetParticipantDataFromPeerIDParamsFilters = "ip_information"
const SessionGetParticipantDataFromPeerIDParamsFiltersPrecallNetworkInformation SessionGetParticipantDataFromPeerIDParamsFilters = "precall_network_information"
const SessionGetParticipantDataFromPeerIDParamsFiltersEvents SessionGetParticipantDataFromPeerIDParamsFilters = "events"
const SessionGetParticipantDataFromPeerIDParamsFiltersQualityStats SessionGetParticipantDataFromPeerIDParamsFilters = "quality_stats"
ReturnsExpand Collapse
type SessionGetParticipantDataFromPeerIDResponse struct{…}
Data SessionGetParticipantDataFromPeerIDResponseDataOptional
ID stringOptional

Participant ID. This maps to the corresponding peerId.

CreatedAt stringOptional

timestamp when this participant was created.

CustomParticipantID stringOptional

ID passed by client to create this participant.

DisplayName stringOptional

Display name of participant when joining the session.

Duration float64Optional

number of minutes for which the participant was in the session.

JoinedAt stringOptional

timestamp at which participant joined the session.

LeftAt stringOptional

timestamp at which participant left the session.

PeerEvents []map[string, unknown]Optional
PeerReport SessionGetParticipantDataFromPeerIDResponseDataPeerReportOptional

Peer call statistics report.

Metadata map[string, unknown]Optional
Quality map[string, unknown]Optional
PresetName stringOptional

Name of the preset associated with the participant.

SessionID stringOptional
formatuuid
UpdatedAt stringOptional

timestamp when this participant’s data was last updated.

UserID stringOptional

User id for this participant.

Success boolOptional

Fetch details of peer

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.Sessions.GetParticipantDataFromPeerID(
    context.TODO(),
    "app_id",
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    realtime_kit.SessionGetParticipantDataFromPeerIDParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "id": "id",
    "created_at": "created_at",
    "custom_participant_id": "custom_participant_id",
    "display_name": "display_name",
    "duration": 0,
    "joined_at": "joined_at",
    "left_at": "left_at",
    "peer_events": [
      {
        "foo": "bar"
      }
    ],
    "peer_report": {
      "metadata": {
        "foo": "bar"
      },
      "quality": {
        "foo": "bar"
      }
    },
    "preset_name": "preset_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updated_at": "updated_at",
    "user_id": "user_id"
  },
  "success": true
}
Returns Examples
{
  "data": {
    "id": "id",
    "created_at": "created_at",
    "custom_participant_id": "custom_participant_id",
    "display_name": "display_name",
    "duration": 0,
    "joined_at": "joined_at",
    "left_at": "left_at",
    "peer_events": [
      {
        "foo": "bar"
      }
    ],
    "peer_report": {
      "metadata": {
        "foo": "bar"
      },
      "quality": {
        "foo": "bar"
      }
    },
    "preset_name": "preset_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updated_at": "updated_at",
    "user_id": "user_id"
  },
  "success": true
}