Skip to main content

getThreadEntries

A Graze API GET request that returns thread entries for a specified thread and 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. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

sitn_id

Number

Yes

Situation ID.

thread_name

String

Yes

Name of the thread to get entries from.

start

Number

Yes

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

limit

Number

Yes

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.

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"
}