I want to add some YouTube videos to my own playlist via Google Apps Script.
I added the necessary resources, and I am able to load videos from the playlist.
The code should be relative simple:
function add_video_to_playlist() { const playlist_id = "MY_PLAYLIST_ID"; const video_id = "dQw4w9WgXcQ"; const video_snippet = { playlistId: playlist_id, resourceId: { kind: "youtube#video", videoId: video_id } } YouTube.PlaylistItems.insert(video_snippet, "snippet"); console.log("Video added successfuly!");}and was inspired by following Stack Overflow answer:https://stackoverflow.com/a/63424661/13278191
But I get a weird error message, whenever I run my function:
GoogleJsonResponseException: API call to youtube.playlistItems.insert failed with error: RequiredJust the word "Required" is not very helpful, but that's all I got, as seen again in this screenshot: Error message
The official error messages page does not have anything listed for this keyword either
Did someone maybe encounter the same error message?