Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

api - Error to update a broadcast : "Id is required"

enter code hereI want to update a broadcast. I tried with the explorer on youtube's live site and it works. I tried with my script and i've an error : "Id is required". I tried with cURL too and i've the same error. This error :

"error": {
    "code": 400,
    "message": "Id is required",
    "errors": [
      {
        "message": "Id is required",
        "domain": "youtube.liveBroadcast",
        "reason": "idRequired",
        "extendedHelp": "https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/update#request_body"
      }
    ]
  }
url='https://youtube.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2C%20status%2C%20contentDetails&key=[KEY]';
request({
        url: url,
        method: 'PUT',
        headers: {
            'Authorization': 'Bearer [TOKEN]', 
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        data: '{"id":"[broadcastId]","contentDetails":{"enableClosedCaptions":true,"enableContentEncryption":true,"enableDvr":true,"enableEmbed":true,"recordFromStart":true,"startWithSlate":true,"monitorStream":{"enableMonitorStream":true,"broadcastStreamDelayMs":5}}}'
    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...