Error 403 Forbidden Youtube V3 API

I have a problem with Youtube Api v3. The problem is that you want to get information from the downloaded video, when you perform the extraction of information for the video, I get 403 Forbidden error message.

If I run url, I use a browser that returns Json me with all the video data.

Visual Studio Error

screenshot 1

The same URL in the browser.

screenshot 2

if (videoId != "") { // If the video has the same description as a video and uploaded to YouTube, then I have removed that was uploaded earlier and upload the newrequest.Service.QueryClientLoginToken(); //Uri urlVideo = new Uri(String.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads/{1}", hipoConfig.canal_youtube, videoId)); This is This is the URL of the version 2.0 Uri urlVideo = new Uri(String.Format("https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&part=snippet", videoId, hipoConfig.clave_api)); Video ExistingVideo = request.Retrieve<Video>(urlVideo); log.escribirInfoLog("Informacion: El video " + ExistingVideo.VideoId + "se elimina de YouTube para ser sustituido"); request.Delete(ExistingVideo); 
+5
source share
1 answer

Have you tried adding OAuth to authorize your request? After checking the description of the code error in the YouTube data API - Errors :

forbidden (403)

Access is denied. The request may not be properly resolved.

You can try adding OAuth using this documentation in the YouTube Data API Overview as a guide.

If your application will use any API methods that require user authorization, check out the authentication guide to learn how to implement OAuth 2.0 Authorization.

+1
source

Source: https://habr.com/ru/post/1246431/


All Articles