Hi,
When querying the GET direct_messages/events/list endpoint, for some twitter accounts using our application (most of them are not impacted though) we receive an empty events array even if the account received/sent some messages during the past 30 days.
In addition to that, we still receive a next_cursor even though the events array is empty, which makes us hit the rate limiting because we keep asking for the next page (we usually have a mechanism stopping the requests once we fetched 500 DMs, but in this case we keep making new requests fetching only an empty array).
This behavior started on Aug 18, 2018, around 7:45 AM (UTC +2)
Here’s what a request looks like:
$ curl -X GET \
'https://api.twitter.com/1.1/direct_messages/events/list.json?count=50&cursor=MTAzMTY0MDM0Nzg2NzI3MTE3NA' \
-H 'Authorization: OAuth oauth_consumer_key=\"[REDACTED]\", oauth_nonce=\"[REDACTED]\", oauth_signature=\"[REDACTED]\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1534853815\", oauth_token=\"[REDACTED]\", oauth_version=\"1.0\"'
{
"events": [],
"next_cursor": "MTAzMTYzOTA2NDU4NjQ2NTI4NA"
}
When we make another query for the next page using next_cursor, we get a similar response.
- Is it normal to have a next cursor even though the API returns an empty array? If so, we’ll submit a PR to the library we’re using to stop iterating on cursors if the previous response was an empty array.
- Could you please have a look at the requests we’re making which are returning an empty event array even though some DMs were sent and received recently? I’d be glad to provide you more information about the twitter accounts concerned privately.
Thanks!