saurabhlahoti
saurabhlahoti

Reputation: 466

Getting 500 - Internal Error Encountered with Youtube Broadcast Insert API

I am trying to insert a LiveBroadcast using Youtube LIVE streaming API.

Here is my request which I made on the API playground on youtube API docs.

POST https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2C%20id%2C%20status%2C%20contentDetails&key=[YOUR_API_KEY] HTTP/1.1

Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "contentDetails": {
    "enableClosedCaptions": true,
    "enableEmbed": true,
    "enableLowLatency": true,
    "recordFromStart": true,
    "enableAutoStart": true,
    "enableAutoStop": true
  },
  "status": {
    "privacyStatus": "public",
    "selfDeclaredMadeForKids": true,
    "liveBroadcastPriority": "high",
    "madeForKids": true
  },
  "snippet": {
    "title": "My broadcasst",
    "description": "My Description",
    "scheduledStartTime": "2020-06-177T03:48:46.46Z",
    "scheduledEndTime": "2020-06-178T11:48:52.52Z"
  }
}

And the response that I am getting is

{
  "error": {
    "code": 500,
    "message": "Internal error encountered.",
    "errors": [
      {
        "message": "Internal error encountered.",
        "domain": "global",
        "reason": "backendError"
      }
    ],
    "status": "INTERNAL"
  }
}

Any help will be appreciated. Thanks in advance

Upvotes: 1

Views: 1179

Answers (2)

saurabhlahoti
saurabhlahoti

Reputation: 466

The error was with the time format string that I had copied from google docs for ISO-8601 format, mentioned for all their time-relatedfields. I suggest creating your format string from here for java code

Upvotes: 1

stvar
stvar

Reputation: 6965

According to the docs, you're not supposed to provide the makeForKids property (that's the job of the API).

When calling for liveBroadcasts.insert endpoint, if wanting to designate the respective broadcast as child-directed, you should use this property instead:

status.selfDeclaredMadeForKids (boolean)

In a liveBroadcasts.insert request, this property allows the channel owner to designate the broadcast as being child-directed. In a liveBroadcasts.list request, the property value is only returned if the channel owner authorized the API request.

The other properties that you shouldn't have set are enableLowLatency and liveBroadcastPriority.

Upvotes: 0

Related Questions