我正在尝试使用消息return 400
The request metadata is invalid
。
这是我的代码:
$videos = $youtube->videos->listVideos('id,snippet,status', array(
'id' => $videoId,
));
$updateVideo = $videos[0];
$date = "2016-10-20T20:00:00.00+00:00";
$updateVideo['status']['embeddable'] = true;
$updateVideo['status']['privacyStatus'] = 'private';
$updateVideo['status']['publicStatsViewable'] =true;
$updateVideo['status']['publishAt'] = $date;
$videoUpdateResponse = $youtube->videos->update('id,snippet,status', $updateVideo);
dd($videoUpdateResponse);
exit();
哪里错了?请帮我!感谢
答案 0 :(得分:1)
From Ibrahim Ulukaya's answer he is one of the developer of youtube api.
To change a field in upload method, you have to put all other fields you get, otherwise the update method will think you are trying to empty them.
In your case, you should include "license" and "publicStatsViewable" in your PUT request just as you get them from your "GET" request.