Filtering direct_messages/events/list

directmessages

#1

Hello,

Is it possible to get Direct Messages between specific timestamps?

I know that it is possible to get events list by calling this endpoint:

twurl -X GET /1.1/direct_messages/events/list.json

It will return something like this:

{
  "next_cursor": "AB345dkfC",
  "events": [
    { "id": "110", "created_timestamp": "900", ... },
    { "id": "109", "created_timestamp": "800", ... },
    { "id": "108", "created_timestamp": "700", ... },
    { "id": "107", "created_timestamp": "600", ... },
    { "id": "106", "created_timestamp": "500", ... },
   
    ...
  ]
}

But let’s say I want to get only events with property created_timestamp between 801 and 599. When I read docs it looks that I would have to go to next page until I find first message out of range. Is it possible to add query params to request, something like this?

twurl -X GET /1.1/direct_messages/events/list.json?from_timestamp=801&to_timestamp=599
{
  "next_cursor": "AB345dkfC",
  "events": [

    { "id": "109", "created_timestamp": "800", ... },
    { "id": "108", "created_timestamp": "700", ... },
    { "id": "107", "created_timestamp": "600", ... }
  ]
}

#2

This is a nice idea, but I’m not aware of any current plan to implement something like this in the Direct Message API.