Reputation: 201
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:
I am not using oAuth.
Anyone know what I'm missing?
Cheers, Jon
Upvotes: 2
Views: 2032
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