Fetch SMS history

Request

GET https://api.46elks.com/a1/sms

Optional request parameters

Parameter Example Description
start 2018-02-14T09:52:07.302000 Retrieve SMS before this date
end 2018-02-14T09:52:07.302000 Retrieve SMS after this date.
limit 40 Limit the number of results on each page
to +46766861004 Filter on recipient

Response

Example JSON response
{
  "data": [
    {
      "id": "s17a6dafb12d6b1cabc053d57dac2b9d8",
      "created": "2017-03-14T09:52:07.302000",
      "direction": "outgoing",
      "from": "MyService",
      "to": "+46704508449",
      "message": "Hello hello",
      "status": "delivered",
      "delivered": "2017-03-14T09:52:10Z",
      "cost": 3500
    },
    {
      "id": "s299b2d2a467945f59e1c9ea431eed9d8",
      "created": "2017-03-14T08:44:34.608000",
      "direction": "outgoing-reply",
      "from": "+46766861069",
      "to": "+46704508449",
      "message": "We are open until 19:00 today. Welcome!",
      "status": "delivered",
      "delivered": "2017-03-14T08:44:36Z",
      "cost": 3500
    },
    {
      "id": "s292d2a459e967945fb1c9ea431eed9d8",
      "created": "2017-03-14T08:44:34.135000",
      "direction": "incoming",
      "from": "+46704508449",
      "to": "+46766861069",
      "message": "Hours?",
      "cost": 3500
    },
    // ...
  ],
  "next": "2017-02-21T14:15:30.427000"
}
Parameter Type Description
data list list of SMS with the same format as in get sms by id.
next string timestamp to the next page if more SMS are available

Additional info

At most 100 SMS can be retrieved at once. Use the start and end parameters to page through the history.