2016-06-29 7 views
0

Ich versuche, youtube Video-Details mit der Video-ID in youtube api v3 zu bekommen. Mit dieser URL:Erhalten von Video-Titel mit Video-ID in youtube api v3 (Android)

https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=AIzaSyCA-EL5sT5LCQnYauNMm2Ku_PukvBcz6ms%20&part=snippet,contentDetails 

ich die Rückkehr von:

{ 
"error": { 
"errors": [ 
{ 
"domain": "usageLimits", 
"reason": "ipRefererBlocked", 
"message": "The Android package name and signing-certificate fingerprint, null and null, do not match the app restrictions configured on your API key. Please use the API Console to update your key restrictions.", 
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=861763996907" 
} 
], 
"code": 403, 
"message": "The Android package name and signing-certificate fingerprint, null and null, do not match the app restrictions configured on your API key. Please use the API Console to update your key restrictions." 
} 
} 

Die api Schlüssel ist der Schlüssel diejenige, die ich nach der Registrierung in Google Entwickler-Konsole die App mit meinem SHA1 Code bekam ist. Wie komme ich über diesen Fehler hinweg?

Antwort

2

Sie einen Dienst mit GET-Methode von mobile.All Sie tun müssen, machen kann, ist eine Server-Schlüssel zu erstellen und diesen Schlüssel und Video-ID mit der URL anhängen und Daten

zum Beispiel erhalten: Wenn Sie verwenden Volley für HTTP-Anfragen dann in JsonOBjectRequest URL-Parameter sollte dies aussehen:

"https://www.googleapis.com/youtube/v3/videos?id=F4HuIqwGuBU&key=YOUR_SERVER_KEY&fields=items(id,snippet(description,channelId,title,categoryId),statistics)&part=snippet,statistics" 

hoffe das hilft.