YouTube API: How to get liveChatId?

The documentation says:

"The liveChatId parameter specifies the identifier of the chat whose messages will be returned. The live chat identifier associated with the broadcast is returned in the snippet.liveChatId property of the liveBroadcast resource."

But when using the APIs Explorer and youtube.liveBroadcasts.list to get the liveBroadcast fragment, there is no liveChatId property for the returned result.

I use the following URI (key omitted):

https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet&mine=true

What am I doing wrong?

Here is the answer (some values ​​replaced by ...):

{
 "kind": "youtube#liveBroadcastListResponse",
 "etag": "...",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 5
 },
 "items": [
  {
   "kind": "youtube#liveBroadcast",
   "etag": "...",
   "id": "...",
   "snippet": {
    "publishedAt": "2016-04-18T17:04:24.000Z",
    "channelId": "...",
    "title": "...",
    "description": "...",
    "thumbnails": {
     "default": {
      "url": "...",
      "width": 120,
      "height": 90
     },
     "medium": {
      "url": "...",
      "width": 320,
      "height": 180
     },
     "high": {
      "url": "...",
      "width": 480,
      "height": 360
     },
     "standard": {
      "url": "...",
      "width": 640,
      "height": 480
     },
     "maxres": {
      "url": "...",
      "width": 1280,
      "height": 720
     }
    },
    "scheduledStartTime": "1970-01-01T00:00:00.000Z",
    "actualStartTime": "2016-04-18T17:04:24.250Z",
    "isDefaultBroadcast": false
   }
  }
 ]
}

At the time of the request, there is also an active conversation in the stream.

-, , "Stream now", liveChatId, .

liveChatId "Stream now"?

+4
3

, , , , , - .

liveChatId , - :

-, videoId

response.items[0].id.videoId

liveStreamingDetails

buildApiRequest('GET',
        '/youtube/v3/videos', {
            'id': videoID,
            'part': 'snippet,contentDetails,statistics,liveStreamingDetails'
        });

liveChatId :

response.items[0].liveStreamingDetails.activeLiveChatId
+4

YouTube API "Stream Now" API. "Stream Now", , API.

, API, .

+1

liveChatId "Stream now"?

, . , Stream Now.

, , , , , broadcastType=all, broadcastType=persistent URI API.

, , . , LiveStream .status.configurationIssues. ( streamName)

. , , . ( thumbnails)

LiveStreams:

URI: https://www.googleapis.com/youtube/v3/liveStreams/?part=status,snippet&default=true 

:  

{
    "kind": "youtube#liveStreamListResponse",
    "etag": "\"j1yhvAPYkjsoF8yjoVGsTlIFzCS/rqgpDvaMrWOPqUrLPxJd4XUFoKg\"",
    "pageInfo": {
        "totalResults": 1,
        "resultsPerPage": 5
    },
    "items": [
    {
        "kind": "youtube#liveStream",
        "etag": "\"j1yhvAPYkjsoF8yjoVGsTlIFzCS/SRutyOE9apA9K1qAdh2s9ZYE-Dp\"",
        "id": "e5LT2xEURi9BQzf2rLe5eB3325081929219850",  <-- liveBroadcasts .boundStreamId
        "snippet": {
            "publishedAt": "2016-09-05T23:21:33.000Z",
            "channelId": "QIr0IE1wRTRj2SUku4eFj0mK",
            "title": "Default Stream",
            "description": "",
            "isDefaultStream": true
        },
        "status": {
            "streamStatus": "active",
            "healthStatus": {
                "status": "good"
            }
        }
    }
    ]
}

LiveBroadcasts:

URI: https://www.googleapis.com/youtube/v3/liveBroadcasts/?part=status,contentDetails,snippet,id&broadcastStatus=active&broadcastType=persistent

:

{
    "kind": "youtube#liveBroadcastListResponse",
    "etag": "\"j1yhvAPYkjsoF8yjoVGsTlIFzCS/MFvQunCBDdqlkhPMness6LN1zao\"",
    "pageInfo": {
        "totalResults": 1,
        "resultsPerPage": 5
    },
    "items": [
    {
        "kind": "youtube#liveBroadcast",
        "etag": "\"j1yhvAPYkjsoF8yjoVGsTlIFzCS/mK_CAQ9rrVulNXbKbeIveFnQPd8\"",
        "id": "eXrevq9RzVQ",
        "snippet": {
            "publishedAt": "2017-05-07T16:58:05.000Z",
            "channelId": "QIr0IE1wRTRj2SUku4eFj0mK",
            "title": "514306-pgju",
            "description": "",
            "scheduledStartTime": "1970-01-01T00:00:00.000Z",
            "actualStartTime": "2017-05-08T01:21:45.000Z",
            "isDefaultBroadcast": true,
            "liveChatId": "NiHXTCKPfAyCJrPgREDRnvMSL0N5LBiVUlZoLSULA9vqyoR"
        },
        "status": {
            "lifeCycleStatus": "live",
            "privacyStatus": "unlisted",
            "recordingStatus": "recording"
        },
        "contentDetails": {
            "boundStreamId": "e5LT2xEURi9BQzf2rLe5eB3325081929219850", <-- LiveStreams .id
            "boundStreamLastUpdateTimeMs": "2016-09-05T23:21:33.749Z",
            "monitorStream": {
                "enableMonitorStream": false
            },
            "enableEmbed": true,
            "enableDvr": true,
            "enableContentEncryption": false,
            "startWithSlate": false,
            "recordFromStart": true,
            "enableClosedCaptions": false,
            "closedCaptionsType": "closedCaptionsDisabled",
            "enableLowLatency": false,
            "projection": "rectangular"
        }
    }
    ]
}

, , , "Stream Now" API, liveChatId, , , , . , , LiveStream, , LiveBroadcast. , .

0

All Articles