I try to use the new YouTube v3 data API to upload videos to YouTube on Android, but I get a 403 forbidden error:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden 01-22 00:10:41.716: WARN/System.err(5209): { 01-22 00:10:41.716: WARN/System.err(5209): "code" : 403, 01-22 00:10:41.716: WARN/System.err(5209): "errors" : [ { 01-22 00:10:41.716: WARN/System.err(5209): "domain" : "youtube.header", 01-22 00:10:41.716: WARN/System.err(5209): "location" : "Authorization", 01-22 00:10:41.716: WARN/System.err(5209): "locationType" : "header", 01-22 00:10:41.716: WARN/System.err(5209): "message" : "Forbidden", 01-22 00:10:41.716: WARN/System.err(5209): "reason" : "youtubeSignupRequired" 01-22 00:10:41.716: WARN/System.err(5209): } ], 01-22 00:10:41.720: WARN/System.err(5209): "message" : "Forbidden" 01-22 00:10:41.720: WARN/System.err(5209): }
The code is as follows:
I got the OAuth2.0 credentials and I used it to instantiate youtube:
YouTube youTube = new YouTube.Builder(new NetHttpTransport(), new JacksonFactory(), credential) .setApplicationName("testapp/1.0") .build();
Any idea?
thanks
source share