Reputation: 50
When I try to get the message body using graphapi I can't get it even if I extract the id and the number of unread messages I was thinking about permission, but I add the read_inbox permission and when trying the tools of developer the message was saying field is empty or disallowed by the access token, and I have this message saying
error": {
"message": "You can only access the \"inbox\" connection for the current user.",
"type": "GraphMethodException",
"code": 100
Upvotes: 1
Views: 925
Reputation: 468
My application reads posts, home, inbox, insights and other data of any user who has logged into my application and have given permission to my application to do these things on his/her behalf. I have found following solution and it worked for reading inbox.
graph.facebook.com/USER_ID?fields=threads
The inbox edge has been deprecated and now threads can be used instead. You need read_page_mailboxes
for pages and read_mailbox
for account to read inbox messages.
Upvotes: 0
Reputation: 22913
As the error message indicates, you probably tried to access the inbox content of a friend.
graph.facebook.com/USER_ID?fields=inbox
For evident privacy reasons, this is impossible. You can only consult your own inbox:
graph.facebook.com/me?fields=inbox
Upvotes: 1