NintendoZaedus
NintendoZaedus

Reputation: 683

Youtube Live Streaming API liveChatNotFound

I am trying to find a way to get all of the messages from a stream and I've gotten so close but then I get an error. For some reason the video ID that I use isn't valid even though it is valid. Maybe I'm getting the wrong id? Here is the XMLHttpRequest:

https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=hHW1oY26kxQ&part=snippet&key={API-KEY}&maxResults=2000

Here is the response:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.liveChat",
    "reason": "liveChatNotFound",
    "message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests \u003ccode\u003eliveChatId\u003c/code\u003e parameter to ensure that it is correct."
   }
  ],
  "code": 404,
  "message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests \u003ccode\u003eliveChatId\u003c/code\u003e parameter to ensure that it is correct."
 }
}

Upvotes: 2

Views: 616

Answers (1)

BASAVARAJ PATIL
BASAVARAJ PATIL

Reputation: 516

pass your video id for the below api and get the actual livechat id

get livechat id (replace with your api key )

https://www.googleapis.com/youtube/v3/videos?id=kpfV38Hcnds&key=AIzaxxxxxxxxxxxxxxxxdQShvisQW_kdY0Yxxx&part=liveStreamingDetails

in the response u will find the livechatid ,pass this live chat id to the below api

get all the chats(replace with your api key )

https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=Cg0KC2twZlYzOEhjbmRz&part=snippet&key=AIzaxxxxxxxxxxxxxxxxdQShvisQW_kdY0Yxxx

Upvotes: 2

Related Questions