2016-04-04 41 views
5

私はYoutube Api v3に問題があります。問題は、アップロードされたビデオから情報を取得したいということです。ビデオのRetrieve情報を実行しているときにエラー403が表示されます。エラー403禁じられたwhith Youtube API V3

ブラウザを使用している場合、私はすべてのビデオデータでJsonを返します。

Visual Studioのエラーブラウザで

screenshot 1

同じURL。

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); 

答えて

1

あなたはあなたの要求を承認するためにはOAuthを追加しようとしたことがありますか?

禁止

(403)

アクセス禁止:YouTube Data API - Errorsのコードエラーの説明を確認する際に。要求が適切に承認されていない可能性があります。

YouTube Data API Overviewのこのドキュメントを参考にしてOAuthを追加できます。

あなたのアプリケーションは、ユーザー 承認を必要とするAPIメソッドを使用する場合は、 OAuth 2.0の承認を実装する方法については、認証ガイドをお読みください。

関連する問題