Moogsoft Docs

getThreadEntries

A Graze API GET request that returns thread entries for a specified 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 Graze API EndPoint Reference.

Request arguments

Endpoint getThreadEntries takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

sitn_id

Number

Yes

Situation ID.

thread_name

String

Yes

Name of the thread to get entries from.

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

Endpoint getThreadEntries returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

entries

List

A list of thread entries. See below.

sitn_id

Number

Situation ID.

thread_name

String

Name of the thread that the entries are from.

The entries list contains the following information:

Name

Type

Description

entry_text

String

Text of the thread entry. Reserved characters are converted to HTML entities, for example, & is converted to &.

user_id

Number

User ID of the user that created the thread entry.

time

Number

Time when the thread entry was created. This is a Unix epoch timestamp in seconds.

entry_id

Number

ID of the thread entry.

API update behavior

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

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint getThreadEntries:

Request example

Example cURL request to return the first 10 thread entries on thread "Support" in Situation 358:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getThreadEntries" --data-urlencode "sitn_id=358" --data-urlencode "thread_name=Support" --data-urlencode "start=0" --data-urlencode "limit=10"
Response example

Example response returning the two thread entries on thread "Support" in Situation 358:

{
    "entries":[
        {
            "entry_text":"Test Entry",
            "user_id":4,
            "time":1549455051,
            "entry_id":2
        },
        {
            "entry_text":"Test Entry",
            "user_id":4,
            "time":1549455053,
            "entry_id":1
        }
    ],
    "sitn_id":358,"thread_name":"Support"
}