https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,player,recordingDetails,statistics,status&id=-Ji6qekcLxM,-rJOifcv3HA,0CN5MvWQwac,0xZLb7zjel8,1JAWiDZbkI0,1TIzLB_L8lk,2Eh08z-eIaE,2zdhM5m9sqQ,3LVjhhYFLTw,4owWEERuFYM,5t5SSBotwC4,6ML-CT4tiFw,7FaPvb72nh4,8c9N_WZbBY8,8dFj1Es8x0w,9HxESrz8UUk,AE_a3SJBhxo,AM5O9iPCw0U,DZktPAbHIfY,GYaLo04ckPQ,MMBtlPlbSzg,Nfy0vyaWJRo,OneZeR09P_c,RZAo93F5Roo,VfE1VyiGHD8,VhLQj7Z42Ho,VjXYAFXPayo,W-DdJZL9EOA,XYEF1H6HsTE,XlxVR4aDt4Y,YKxOYkzndlk,Z7exBz2PbyU,cFV4Gp9llBI,crqkHbMp0P8,damF3y8PC-Y,eJ79X5qR3pw,fHuNLi61nV0,iXJRgHXDY_o,jJ-XEAZCFus,kwnPrVQURg8,m40j71fet9o,nsjpgiramd0,paTpsjtsk9E,pzPjqe_UsO0,qzG-1gLm2sA,rRctYmNSln8,tpXcVmPEKeQ,uYbtNouVQBI,vEZWuM8Y6gQ,xKmrmmslPGo,yn9ceFwo1H8,zcxH8jQQu0A&maxResults=50&key={MyKey}
私は次の方法を使用して応答を取得していますが、私の観察に従っていくつかのエラーが発生しています。いくつかのエラーを示す新しいビデオIDがあります
private JSONObject getResponse(String apiUrl) {
HttpClient client = new DefaultHttpClient();
HttpUriRequest request = new HttpGet(apiUrl);
try {
HttpResponse response = client.execute(request);
String jsonString = StreamUtils.convertToString(response.getEntity().getContent());
JSONObject mJson = new JSONObject(jsonString);
return mJson;
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (Exception e) {
}
return null;
}
応答のエラーは次のとおりです
400 Bad Request
- Show headers -
{
"error": {
"errors": [
{
"domain": "youtube.parameter",
"reason": "invalidFilters",
"message": "Bad Request",
"locationType": "parameter",
"location": ""
}
],
"code": 400,
"message": "Bad Request"
}
}