Is possible get private messages of a page?

322 views
Skip to first unread message

Carlos Esquivel

unread,
May 9, 2013, 6:44:18 AM5/9/13
to res...@googlegroups.com
Hello,

Is possible get private messages of a page??

Marcel Stör

unread,
May 9, 2013, 3:29:22 PM5/9/13
to res...@googlegroups.com
On 09.05.13 12:44, Carlos Esquivel wrote:
> Hello,
>
> Is possible get private messages of a page??

Check http://developers.facebook.com/docs/reference/api/page/ to find
out what the FB API offers.

Cheers,
Marcel

--
Marcel Stör, http://frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Carlos Esquivel

unread,
May 10, 2013, 2:01:10 AM5/10/13
to res...@googlegroups.com
and with RestFB?

Marcel Stör

unread,
May 10, 2013, 2:16:10 AM5/10/13
to res...@googlegroups.com
On 10.05.13 08:01, Carlos Esquivel wrote:
> and with RestFB?

restfb.com:

"RestFB is a simple and flexible Facebook Graph API and Old REST API
client written in Java"

Hence, RestFB is just an abstraction over the FB Graph API. If you need
'me/feed' from FB then the RestFB way of doing this is:

facebookClient.fetchConnection("me/feed", Post.class);

You really need to read the RestFB docs.

Cheers,
Marcel

> El jueves, 9 de mayo de 2013 21:29:22 UTC+2, marcelstoer escribió:
>
> On 09.05.13 12:44, Carlos Esquivel wrote:
> > Hello,
> >
> > Is possible get private messages of a page??
>
> Check http://developers.facebook.com/docs/reference/api/page/
> <http://developers.facebook.com/docs/reference/api/page/> to find
> out what the FB API offers.

Carlos Esquivel

unread,
May 10, 2013, 2:34:41 AM5/10/13
to res...@googlegroups.com
Hello  Marcel,

I do

Connection<Conversation> myFeed = facebookClient2.fetchConnection("ID_PAGE/conversations", Conversation.class);

but this is not correct. This return :
com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: (#210) Subject must be a page.

How could I get private messages from a page?

Thanks

Shai Berger

unread,
May 10, 2013, 8:29:10 AM5/10/13
to res...@googlegroups.com
IIRC you need to get a page access token.

Carlos Esquivel

unread,
May 13, 2013, 7:04:28 AM5/13/13
to res...@googlegroups.com
I have a page access_token, but can not get private messages on pages

S13_Alan

unread,
May 15, 2013, 7:35:52 AM5/15/13
to res...@googlegroups.com
Your code is correct and should work, it's just a token issue and does look like you're using the user token rather than page token given that message.

If you've got a users token then visit me/accounts to fetch the tokens for the pages (you need the manage_pages permission of course) - https://graph.facebook.com/me/accounts?access_token=XXX

Remember to have asked for the extended permission called 'read_page_mailboxes' when authorising the app in the first place, otherwise you won't be able to read the conversations anyway.

Once you've got the correct token then try getting the conversations via the Graph API explorer, or just in the browser first to make sure. That should be easy enough. Something like.... https://graph.facebook.com/page_id/conversations?access_token=XXX

Hope that might help a bit, but if the token parts above are all right, then it should work!

Alan.

Carlos Esquivel

unread,
May 16, 2013, 2:34:48 AM5/16/13
to res...@googlegroups.com
Thank you very much, I've been a big help
Reply all
Reply to author
Forward
0 new messages