I'm trying to do an integration with YouTube, but I'm getting the error
{"The remote server returned an error: (401) Unauthorized."}
I released my api key as the image below and I'm testing this code below, could someone help me by showing what is missing?
YouTubeRequestSettings settings = new YouTubeRequestSettings("VideoToYoutube", "AIzaSyBiXxL5nS6IjYRGJUhDdaYdWGqAGwOvD8A");
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = "Teste";
newVideo.Tags.Add(new MediaCategory("teste", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "Teste";
newVideo.Description = "Teste";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("teste, teste",
YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
newVideo.YouTubeEntry.MediaSource = new MediaFileSource("C:\Users\tadriano\Documents\streaming\mov_bbb.mp4", "video/mp4");
try
{
var createdVideo = request.Upload(newVideo);
}
catch (System.Exception ex)
{
var teste = ex.Message;
throw;
}
return View();
}