rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

android - youtube data api - videos.list "access not configured" #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client (e.g. 1.15.0-rc)?
1.15.0-rc
youtube api services r52

Java environment (e.g. Java 6, Android 2.3, App Engine)?
Android sdk 17

I am trying to retrieve snippet and contentDetails data for a specific video. I 
have created a sha1-fingerprint of my local debug key and created an android 
app key with it (and my app package name). I also made sure to activate the 
youtube api service for the app key.

I built a little helper class, that extends AsyncTask to make the youtube 
request (see it attached). It takes ids of videos and requests the data.

I have activated the logging for my testing. And here is, what is send to the 
server:

GET 
https://www.googleapis.com/youtube/v3/videos?id=A3PDXmYoF5U&key=<MY_GOOGLE_API_K
EY>&part=snippet,contentDetails
Accept-Encoding: gzip
User-Agent: FaceCam Google-HTTP-Java-Client/1.15.0-rc (gzip)

And here is, what I get back:

403 Forbidden
Cache-Control: private, max-age=0
Content-Encoding: gzip
Content-Length: 138
Content-Type: application/json; charset=UTF-8
Date: Wed, 22 May 2013 10:30:14 GMT
Expires: Wed, 22 May 2013 10:30:14 GMT
Server: GSE
X-Android-Received-Millis: 1369218614687
X-Android-Sent-Millis: 1369218614458
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block

{
   "error": {
      "errors": [
         {
            "domain": "usageLimits",
            "reason": "accessNotConfigured",
            "message": "Access Not Configured"
         }
      ],
      "code": 403,
      "message": "Access Not Configured"
   }
}

I expect the server to send me the actual video data. I cannot see, what would 
be wrong.

Original issue reported on code.google.com by sven.bu...@gmail.com on 22 May 2013 at 10:52

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Sven,

Sorry for the difficulties you're having.  Setting up usage limits for Android 
applications has a few catches.  For one, make sure the package name you're 
using in the code snippet is globally unique.  Yours needs to be the only 
application in the APIs console that uses this package name.  Try changing it 
to something you are certain nobody else would use.  If you're still having 
difficulties, feel free to post a message on www.stackoverflow.com using the 
tag [google-api-java-client] or on our Google Group here: 
https://groups.google.com/forum/?hl=en_US&fromgroups#!forum/google-api-java-clie
nt

Original comment by ngmic...@google.com on 28 May 2013 at 2:05

GoogleCodeExporter commented 9 years ago
Hi Sven,
I had a similar issue in my android app as well, I ended up trying the API key 
for 'Key for browser apps' instead of the API key from 'Key for Android apps' 
and that fixed my issue.

Original comment by feiyingx...@gmail.com on 6 Nov 2013 at 5:04