A MoogDb v2 method that returns thread entries for a thread in a Situation. Threads are comments or 'story activity' on Situations.
You can request to return specific thread entries using start
and limit
values. If not, their default values return the first 100 entries. The entries returned are ordered by most recent first.
Back to MoogDb V2 API Method Reference.
Method getThreadEntries
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| Number | Yes | Situation ID. |
| String | Yes | Name of the thread. |
| Number | Yes | Number of the first thread entry to return. Default is 0. |
| Number | Yes | Maximum number of thread entries to return. Default is 100. |
Method getThreadEntries
returns the following response:
Type | Description |
---|---|
JSON Object | A JSON object containing details of the requested thread entries. |
The following examples demonstrate typical use of method getThreadEntries
:
Example request to return the thread entries for thread "Support" on Situation ID 58:
var threadEntries = moogdb.getThreadEntries(58, “Support”, 0, 10);
Example response returning two thread entries on the specified thread:
{
"entries": [
{
"uid": 3,
"entry": "A comment",
"agrees": [],
"total_comments": 0,
"thread_id": "Support",
"mmid": -1,
"sig_id": 58,
"entry_id": 2,
"timed_at": 1423226829,
"disagrees": [],
"commenters": []
},
{
"uid": 3,
"entry": "Another comment",
"agrees": [],
"total_comments": 0,
"thread_id": "Support",
"mmid": -1,
"sig_id": 58,
"entry_id": 1,
"timed_at": 1423226807,
"disagrees": [3],
"commenters": []
}],
"total_entries": 2
}