posts in group feed have unavailable content
Asked Answered
J

2

8

I am an admin of a private group in facebook and I would like to use facebook API to scrap all group posts.

I used graph api explorer to generate an access token with read_stream, friends_group and user_groups permissions.

When I access the group post with https://graph.facebook.com/GROUP_ID/feed?access_token=TOKEN I get a data array with each post but the caption element has the value

"Attachment UnavailableThis attachment may have been removed or the person who shared it may not have permission to share it with you." and all the other fields such as link, message, etc ... are not present.

If I open the facebook group using the browser I can see all posts.

Am I missing something here ?

Jugglery answered 5/9, 2012 at 16:4 Comment(3)
Is it a Private group that you admin ? Are you unable to view the posts made by users of the group ? If so, sounds like a bug that you should file here - developers.facebook.com/bugsPurple
Well the posts are present in the json object but I can't get its content. I think the problem is that when the type of the post is status you don't get any other info than caption which is not useful for me. Actually the type "status" is not even in the documentation of PostJugglery
I've created a bug issue in facebook, please feel free to subscribe it and mark it as replayable.developers.facebook.com/bugs/…Jugglery
A
0

This issue appears to have been corrected. I can access all the Group content for my private group as long as I have a valid Auth Token.

Arrowroot answered 24/3, 2015 at 19:44 Comment(0)
P
0

Below is the code where I fetch the posts of a group in a JSON Object. This JSON object contains a JSON Array of "data". This further contains a separate JSON array for messages (or status of the post).

GraphRequest.newGraphPathRequest(
            accessToken, "/id/posts",
            new GraphRequest.Callback() {
                @Override
                public void onCompleted(GraphResponse      graphResponse) {

                    try {
graphResponse.getRawResponse();

                        m=graphResponse.getJSONObject();
                        JSONArray n=m.getJSONArray("data");
                        messages=new String[n.length()];
                        for(int i=0;i<n.length();i++) {
                            JSONObject a = n.getJSONObject(i);
                            messages[i]=a.optString("message");
                        }

                        list.setAdapter(new   ArrayAdapter<String>   (fb.this,android.R.layout.simple_list_item_1,messages));

                    } catch (Exception e) {
                        Toast.makeText(fb.this, "error is: " +   e.toString(), Toast.LENGTH_LONG).show();
                    }
                }
            }).executeAsync();
Probity answered 19/6, 2015 at 1:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.