Option to sort activities

We need to get 3 last recents activities of a contact to show to our agents. We plan to use this API:

With this API, we cannot use filters to receive only the activities that we look for. We have to get all activities and then do the sort ourselves. This increase network bandwith and CPU consumption.

What do you think about adding these parameters?

  • “sort_by”: Optional. Allowed value:
    “creation_date”: Sort by creation date
    “default”: This is the default value. Results will be sorted as they are now.
  • “sort_direction”: Optional. Allowed values:
    asc: Ascending
    desc: Descending

That way, to get last 3 activities, we could call the endpoint with sort_by=creation_date&sort_direction=desc&limit=3

Hey David,

Have you tried creating a filter that fits your need ( POST/filters) and then using the GET/activities endpoint with a filter_id integer?

Hi David,

Can I get 3 last activities using a filter? I cannot find a way to do it after having read the doc about filter.