Get List Items

To review all items associated with a particular list, use the WebEOCListItem GetListItems call. Attributes for this endpoint are listed below. Sub items are not returned by this method.

GetListItems endpoint description
Description Returns all items associated with a particular list
URL /lists/[listName]/listitems
Method GET
Parameter

listName

Return Type listname
Sample JSON Response
Copy Code
[
    {
        "color": "",
        "name": ""
    },
    {
        "color": "#ff0000",
        "name": "Closed"
    },
    {
        "color": "#ffff00",
        "name": "Full"
    },
    {
        "color": "#00ff00",
        "name": "Open"
    },
    {
        "color": "",
        "name": "(Select)"
    }
]    
                    

Review the parameter definitions and examples of how to use the GetListItems endpoint in JavaScript and C# calls.

Parameter

GetListItems endpoint parameter
Variable Name Type Description Required
listName String Name of the WebEOC Nexus list you want to retrieve information on True (URL)

WebEOCListItem: Custom Objects

The WebEOCListItem type, returned when using the GetListItems endpoint, contains several unique, custom objects. These custom objects are defined as follows:

Custom objects members
Member Name Type Description
name String Name of the list item
color hex color code string Color associated with the list item
subitems List of WebEOCListItems Recursive list of itself

Examples

JavaScript Call

Copy Code
await fetch(`${baseUrl}/lists/Shelter Status/listitems`)
.then((response) => response.json())

C# Call

Copy Code
public async Task<WebEOCListItem[]> GetListItems()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var response = await httpClient.GetAsync($"{baseUrl}/lists/Shelter Status/listitems");
var data = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<WebEOCListItem[]>(data);
}
}