The Facebook server returns zero data on request. The request in the Graph API gives me the correct JSON data

I am trying to get photos from a specific album on facebook. Trying the below URL gives me perfect data when prompted in Graph API Explorer . But it returns null in my application code.

Also, when I tried in the browser, it returns me

 { "data": { ] } 

which is basically null

URL = " https://graph.facebook.com/3386086936429/photos?limit=10 ";

 try { HttpClient hc = new DefaultHttpClient(); HttpGet get = new HttpGet(URL); HttpResponse rp = hc.execute(get); String st=rp.toString(); Log.e("RESPONSE", st); Log.e("ACCESS_TOKEN",at); if (rp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String queryAlbums = EntityUtils.toString(rp.getEntity()); int s=rp.getStatusLine().getStatusCode(); String a=String.valueOf(s); Log.e("RESPONSE-IF", a); JSONObject JOTemp = new JSONObject(queryAlbums); JSONArray JAPhotos = JOTemp.getJSONArray("data"); Log.e("JSONArray", String.valueOf(JAPhotos)); Log.e("JSONArray-Length",String.valueOf(JAPhotos.length())); 

Log ::

 02-14 00:12:34.280: E/RESPONSE(1320) org.apache.http.message.BasicHttpResponse@40518ac8 02-14 00:12:34.301: E/RESPONSE-IF(1320): 200 02-14 00:12:34.310: E/JSONArray(1320): [] 02-14 00:12:34.310: E/JSONArray-Length(1320): 0 

You are welcome. Can someone help me where I am wrong during requests?

Any help would be appreciated!

+1
source share
1 answer

When I try to visit your Facebook identifier or request it through the Graph API, I get the error "Unsupported receive request." This tells me that either you have the wrong identifier or that this identifier has restrictions on who can view it.

If you can view this information, you can only get this information if you have an access token from a user who meets the restrictions of this object.

0
source

All Articles