Reference
Fuselage
Channel History
Retrieves the messages from a channel.
URL
Requires Auth
HTTP Method
/api/v1/channels.history
yes
GET

Query Parameters

Argument
Example
Required
Description
roomId
ByehQjC44FwMeiLbX
Required
The channel's id
latest
2016-09-30T13:42:25.304Z
Optional Default: now
The end of time range of messages to retrieve
oldest
2016-05-30T13:42:25.304Z
Optional Default: n/a
The start of the time range of messages to retrieve
inclusive
true
Optional Default: false
Whether messages which land on latest and oldest should be included
offset
10
Optional Default: 0
The offset of the list messages to retrieve
count
100
Optional Default: 20
The amount of messages to retrieve
unreads
false
Optional Default: false
Whether the amount of unreads should be included.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
http://localhost:3000/api/v1/channels.history?roomId=ByehQjC44FwMeiLbX
Copied!

Example Result

1
{
2
"messages": [
3
{
4
"_id": "AkzpHAvZpdnuchw2a",
5
"rid": "ByehQjC44FwMeiLbX",
6
"msg": "hi",
7
"ts": "2016-12-09T12:50:51.555Z",
8
"u": {
9
"_id": "y65tAmHs93aDChMWu",
10
"username": "testing"
11
},
12
"_updatedAt": "2016-12-09T12:50:51.562Z"
13
},
14
{
15
"_id": "vkLMxcctR4MuTxreF",
16
"t": "uj",
17
"rid": "ByehQjC44FwMeiLbX",
18
"ts": "2016-12-08T15:41:37.730Z",
19
"msg": "testing2",
20
"u": {
21
"_id": "bRtgdhzM6PD9F8pSx",
22
"username": "testing2"
23
},
24
"groupable": false,
25
"_updatedAt": "2016-12-08T16:03:25.235Z"
26
},
27
{
28
"_id": "bfRW658nEyEBg75rc",
29
"t": "uj",
30
"rid": "ByehQjC44FwMeiLbX",
31
"ts": "2016-12-07T15:47:49.099Z",
32
"msg": "testing",
33
"u": {
34
"_id": "nSYqWzZ4GsKTX4dyK",
35
"username": "testing1"
36
},
37
"groupable": false,
38
"_updatedAt": "2016-12-07T15:47:49.099Z"
39
},
40
{
41
"_id": "pbuFiGadhRZTKouhB",
42
"t": "uj",
43
"rid": "ByehQjC44FwMeiLbX",
44
"ts": "2016-12-06T17:57:38.635Z",
45
"msg": "testing",
46
"u": {
47
"_id": "y65tAmHs93aDChMWu",
48
"username": "testing"
49
},
50
"groupable": false,
51
"_updatedAt": "2016-12-06T17:57:38.635Z"
52
}
53
],
54
"success": true
55
}
Copied!

Change Log

Version
Description
0.75.0
Added offset property
0.47.0
Added
Last modified 8mo ago
Export as PDF
Copy link
Edit on GitHub