I was just about to post a new topic on this exact same thing.
I have posted a question on StackOverflow as well seeing if others have noticed something similar.
According to the docs for both direct_messages and direct_messages/sent (emphasis mine);
Returns the 20 most recent direct messages sent by the authenticating user. Includes detailed information about the sender and recipient user. You can request up to 200 direct messages per call, up to a maximum of 800 outgoing DMs.
I want to grab that maximum 800, I have tried two types of call for this — What am I doing wrong or is there a mistake in the API docs?;
Using Pages
Using count and pages I figured I would be able to page through to page 4 with a count of 200 (making the 800).
api.twitter.com/1.1/direct_messages.json?count=200&page=1 works and returns 200 results
api.twitter.com/1.1/direct_messages.json?count=200&page=2 works but returns 0 results
The same happens when using direct_messages/sent.json
Using max_id
When calling api.twitter.com/1.1/direct_messages.json?count=200 I noted that the returned DMs are ordered by the newest first. So I grabbed the ID of the earliest DM of the 200 and fed that into max_id, assuming then this would give me the next 200 that were earlier than this.
api.twitter.com/1.1/direct_messages.json?count=200&max_id=482007447041609700 works but returns 0 results