Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
86 lines (75 loc) · 3.29 KB

File metadata and controls

86 lines (75 loc) · 3.29 KB

Get Channel History

Retrieves the history of a channel.

HTTP MethodURLRequires Auth
GET/api/v1/channels.historyyes

Query Parameters

This endpoint supports the Pagination parameters.

KeyExample ValueDescription
roomId* or roomName*ByehQjC44FwMeiLbX or generalThe channel ID or name. You must enter at least one of these parameters.
latest2016-09-30T13:42:25.304ZThe end of time range of messages to retrieve. The default value is the current date and time.
oldest2016-05-30T13:42:25.304ZThe start of the time range of messages to retrieve
inclusivetrueWhether messages which land on the latest and oldest dates should be included. The default value is false.
unreadsfalseWhether the number of unread messages should be included. The default value is false.
showThreadMessagestrueWhether thread messages should be included in the response.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     https://localhost:3000/api/v1/channels.history?roomId=ByehQjC44FwMeiLbX

Example Response

{
  "messages": [
    {
      "_id": "AkzpHAvZpdnuchw2a",
      "rid": "ByehQjC44FwMeiLbX",
      "msg": "hi",
      "ts": "2016-12-09T12:50:51.555Z",
      "u": {
        "_id": "y65tAmHs93aDChMWu",
        "username": "testing"
      },
      "_updatedAt": "2016-12-09T12:50:51.562Z"
    },
    {
      "_id": "vkLMxcctR4MuTxreF",
      "t": "uj",
      "rid": "ByehQjC44FwMeiLbX",
      "ts": "2016-12-08T15:41:37.730Z",
      "msg": "testing2",
      "u": {
        "_id": "bRtgdhzM6PD9F8pSx",
        "username": "testing2"
      },
      "groupable": false,
      "_updatedAt": "2016-12-08T16:03:25.235Z"
    },
    {
      "_id": "bfRW658nEyEBg75rc",
      "t": "uj",
      "rid": "ByehQjC44FwMeiLbX",
      "ts": "2016-12-07T15:47:49.099Z",
      "msg": "testing",
      "u": {
        "_id": "nSYqWzZ4GsKTX4dyK",
        "username": "testing1"
      },
      "groupable": false,
      "_updatedAt": "2016-12-07T15:47:49.099Z"
    },
    {
      "_id": "pbuFiGadhRZTKouhB",
      "t": "uj",
      "rid": "ByehQjC44FwMeiLbX",
      "ts": "2016-12-06T17:57:38.635Z",
      "msg": "testing",
      "u": {
        "_id": "y65tAmHs93aDChMWu",
        "username": "testing"
      },
      "groupable": false,
      "_updatedAt": "2016-12-06T17:57:38.635Z"
    }
  ],
  "success": true
}

Change Log

Version Description
0.75.0 Added offset property
0.47.0 Added