I was wondering why is that that some channels return an array in the following code and other don't? I'm trying to make a video gallery but the specific channel won't return me that array that has contentDetails. I also have access to the youtube account if I need to change any settings in there to allow this code to work. I also already have api credentials and added API v3 to the project.
$(document).ready(function() { $.get("https://www.googleapis.com/youtube/v3/channels", { part: 'contentDetails', forUsername: channelName, key: 'myKeyvalue'}, function(data) { console.log(data); //upload_id = data.items[0].contentDetails.relatedPlaylists.uploads; } )}Thanks in advance.
The data object should contain an array.