Moogsoft Docs

getThreadEntries

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.

Request arguments

Method getThreadEntries takes the following request arguments:

Name

Type

Required

Description

situationId

Number

Yes

Situation ID.

thread

String

Yes

Name of the thread.

start

Number

No

Number of the first thread entry to return. Default is 0.

limit

Number

No

Maximum number of thread entries to return. Default is 100.

Response

Method getThreadEntries returns the following response:

Type

Description

JSON Object

A JSON object containing details of the requested thread entries.

API behavior in active and historic databases

The behavior of this method depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates or returns information about the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method getThreadEntries:

Request example

Example request to return the thread entries for thread "Support" on Situation ID 58:

var threadEntries = moogdb.getThreadEntries(58, “Support”, 0, 10);

Response example

Example response returning two thread entries on the specified thread:

{ 
  "entries": [
              {
                  "uid": 3,
                  "entry": "This one is important. Another comment",
                  "agrees": [],
                  "total_comments": 0,
                  "thread_id": "Support",
                  "mmid": -1,
                  "sig_id": 58,
                  "entry_id": 2,
                  "timed_at": 1423226829,
                  "disagrees": [],
                  "commenters": []
              },
              {
                  "uid": 3,
                  "entry": "No comment. A 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
}