The advanced query options are used to adjust requests for specific information from all your group chats.
You can combine any of the query options. e.g. limit=10&orderBy=name.
Note: some routes, like read messages, support different options
Using the limit and offset parameters, you can request different subsets of collections.
In this example we will request the 10 messages of a chat room, starting in index 201.
i.e the records in places 201, 201, ... 210
curl \
-X GET \
"https://api.rumbletalk.com/chats/123/messages?limit=10&offset=201" \
-H "Authorization: Bearer <token>"
{
"status": true,
"count": 10,
"data": [
{
"messageId": 12345,
"time": 1458846012,
"userId": 12,
"image": "",
"userName": "Jake",
"text": "Hi!"
},
{
"messageId": 12346,
"time": 1458846018,
"userId": 2,
"image": "",
"userName": "John",
"text": "Hello Jake!"
},
...
]
}
Using the orderBy parameter, we can order the requested collection by some* of the paramters
In this example we will request our group chat rooms, ordered by name.
curl \
-X GET \
"https://api.rumbletalk.com/chats?orderBy=name" \
-H "Authorization: Bearer <token>"
{
"status": true,
"count": 5,
"data": [
{
"id": 145423,
"name": My Chat,
...
},
{
"id": 1220,
"name": RumbleChat,
...
},
...
]
}
Using the search parameter, we can search our collections by specific parameter values.
Every route has a subset of parameters that the request can be filtered by
In this example we will request all of messages containing the string "hello", that were sent between 2018-07-04 19:00:00 and 2018-07-04 20:23:25
curl \
-X GET \
"https://api.rumbletalk.com/chats/123/messages?search=text~hello&time$1530720000:1530725005" \
-H "Authorization: Bearer <token>"
{
"status": true,
"count": 5,
"data": [
{
"messageId": 145423,
"text": "Hello Cindy",
"time": 1530720015
...
},
{
"messageId": 145500,
"text": "I've tried the hello world one",
"time": 1530720315
...
}
...
]
}
Using the query parameter, we can search for a specific phrase within the queryable* parameters of the route.
In this example we will request the messages of a chat, that contain the phrase "william".
curl \
-X GET \
"https://api.rumbletalk.com/chats/123/messages?query=william" \
-H "Authorization: Bearer <token>"
{
"status": true,
"count": 4,
"data": [
{
"messageId": 12345,
"time": 1458846012,
"userId": 12,
"image": "",
"userName": "William Johnson",
"text": "Hi there!"
},
{
"messageId": 12345,
"time": 1458846012,
"userId": 12,
"image": "",
"userName": "Tim Marrik",
"text": "Hi William! How are you today?"
},
...
]
}