Skip to content
Advertisement

Youtube Data API UnknowPart Error When Create Broadcasting

I’m trying to create Youtube live stream through my webpage via Youtube Data API. Whatever I tried, keep getting that error:

JavaScript

Unfortunately, this error doesn’t explain anything, and I couldn’t find anything to help me to solve it. I hope someone can explain what is going on here.

I put all relative files down below and added some comments.

web.php

JavaScript

YoutubeController.php

JavaScript

I use an abstract class for authentication codes.

JavaScript

YoutubeStreamService.php

JavaScript

Advertisement

Answer

As per the official specification, your call to the LiveBroadcasts.insert API endpoint has to include the request parameter:

part (string)

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.

The part properties that you can include in the parameter value are id, snippet, contentDetails, and status.

In PHP, that requirement boils down to having your API call like the one below:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement