Search code examples
facebook-graph-apifacebook-javascript-sdkmessageinbox

Can't get more than 50 messages through Graph API


Running

FB.api('/me/inbox', {limit:800}, function(response){ console.log(response)});

logs

data: Array[50]
summary: Object

to the console, clearly only 50 messages. Setting the limit to a less high value, say 51, produces the same result.

How can this be solved?

I have already looked at pagination (http://stackoverflow.com/questions/5023757/how-does-paging-in-facebook-javascript-api-works) , but as it seems, no pagination data is returned when I run this request.


Solution

  • Try using the until parameter for pagination of your inbox.

    /me/threads?until=2011-05-01

    The new inbox is now called threads rather than inbox. See https://developers.facebook.com/docs/reference/api/thread/ (yes in the Graph API Explorer it is plural rather than what the documentation shows as singular)