Skip to content

Session log sorted from most old to most recent #281

@zontarian

Description

@zontarian

Right now if I call

https://aida-stg.instedd.org/api/v1/bots/<BOD_ID>/sessions/<SESSION_UUID>/log?access_token=<API_ACCESS_TOKEN>

I get an array of conversation items in a sort of random order. The are not sorted it seems..

{
   "data": [
    ....
    {
      "timestamp": "2018-10-03T15:27:52.234410Z",
      "direction": "outgoing",
      "content_type": "text",
      "content": "Send UNSUBSCRIBE to stop receiving messages."
    },
    {
      "timestamp": "2018-10-03T15:27:52.078404Z",
      "direction": "incoming",
      "content_type": "text",
      "content": "Hello"
    },
    {
      "timestamp": "2018-10-03T15:27:55.633163Z",
      "direction": "incoming",
      "content_type": "text",
      "content": "INTRO"
    },
    {
      "timestamp": "2018-10-03T15:27:52.181208Z",
      "direction": "outgoing",
      "content_type": "text",
      "content": "Welcome to WFP test bot. "
    }
  ]
}

Can we specify a default sorting somehow?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions