Search code examples
facebookfacebook-graph-apifacebook-android-sdk

accessing facebook messages


Basically I want to count the messages exchanged by a user with his friends by accessing his Facebook messages(inbox,outbox,etc.). Through Facebook graph API I learnt that the following links will give me JSON objects of Thread type.

https://graph.facebook.com/me/inbox?access_token=
https://graph.facebook.com/me/outbox?access_token=

But it seems that the data retrieved does not provide messages exchanged with all my friends. Some of my friends with whom I have exchanged messages are not shown in either of the two links. Does anyone know how can I retrieve all of the messages????

EDIT:

I have also found out that it shows messages of the last 25 persons you have had chats with. Also that in each chat, only last 25 conversation/messages exchanged. If one has around 500-600 friends, how can I get messages list for all of the friends??


Solution

  • I have also found out that it shows messages of the last 25 persons you have had chats with. Also that in each chat, only last 25 conversation/messages exchanged.

    You should’ve got paging URLs with the response – those you have to follow yourself to get more data.

    Besides that you could also try setting higher limit (and offset, for the next chunk off data) - see https://developers.facebook.com/docs/reference/api/ under „Paging”.