user3049320
user3049320

Reputation: 201

YouTube Data API v3 - 403 : Access Not Configured

For some reason I cannot get youtube v3 API service configured for an android app. I repeatedly get the error 403 : Access Not Configured.

Example code:

try 
    {
        youtube = new YouTube.Builder(HTTP_TRANSPORT, JSON_FACTORY, new HttpRequestInitializer() {
            public void initialize(HttpRequest request) throws IOException {}
        }).setApplicationName("appname").build();

        String queryTerm = "MC";

        YouTube.Search.List search = youtube.search().list("id,snippet");

        search.setKey(DeveloperKey.DEVELOPER_KEY);
        search.setQ(queryTerm);


        search.setType("video");


        search.setFields("items(id/kind,id/videoId,snippet/title,snippet/thumbnails/default/url)");
        search.setMaxResults(NUMBER_OF_VIDEOS_RETURNED);
        SearchListResponse searchResponse = search.execute();

        List<SearchResult> res = searchResponse.getItems();


        return res;

I have set the following:

  1. Registered a google cloud project in the cloud console.
  2. Under API's & Auth I have turned "YouTube Data API v3" ON. It is the only service ON.
  3. I have registered my Android application "appname" which matches the argument passed to "setApplicationName" above.
  4. I used the Eclipse -> Window -> Preferences -> Android -> Build menu to give me the SHA1 of the debug.keystore. I verified that the package name from my AndroidManifest.xml package="test.project".
  5. I have taken the google cloud "Android Key -> Api Key" and set this to the request: search.setKey(DeveloperKey.DEVELOPER_KEY);
  6. I have double checked that eclipse is signing the package with the debug.keystore.

I am not using oAuth.

Anyone know what I'm missing?

Cheers, Jon

Upvotes: 2

Views: 2032

Answers (1)

user3049320
user3049320

Reputation: 201

OK I am guessing the reason that google was blocking my requests was that they expected any android requests to come via oAuth?

I was able to get this working by registering a web app and using the browser key.

Upvotes: 1

Related Questions