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 |
---|---|---|---|
| String | Yes | A valid |
| Number | Yes | Situation ID. |
| String | Yes | Name of the thread to get entries from. |
| 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. |
Response
Endpoint getThreadEntries
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| List | A list of thread entries. See below. |
| Number | Situation ID. |
| String | Name of the thread that the entries are from. |
The entries
list contains the following information:
Name | Type | Description |
---|---|---|
| String | Text of the thread entry. Reserved characters are converted to HTML entities, for example, |
| Number | User ID of the user that created the thread entry. |
| Number | Time when the thread entry was created. This is a Unix epoch timestamp in seconds. |
| 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" }