Get a List
To view information about a particular list, including all its sub-lists, use the WebEOCListItem GetList call.
| Description | Returns information on a particular list, including that list's sub-lists |
|---|---|
| URL | /lists/[listName] |
| Method | GET |
| Parameter |
listName |
| Return Type | WebEOC ListItem |
| Sample JSON Response | See the code below this table |
Copy Code
{
"color": null,
"name": "List01",
"subitems": [
{
"color": "#caff61",
"name": "ListItem01",
"subitems": [
{
"color": "#ff8519",
"name": "SubItem01",
"subitems": [
{
"color": "#8a9dff",
"name": "SubSubItem01",
"subitems": null
}
]
},
{
"color": "",
"name": "SubItem02",
"subitems": null
}
]
},
{
"color": "",
"name": "Item02",
"subitems": [
{
"color": "#5eefff",
"name": "SubItem01",
"subitems": null
}
]
}
]
}
Review the parameter definitions and examples of how to use the GetList endpoint in JavaScript and C# calls.
Parameter
| Variable Name | Type | Description | Required |
|---|---|---|---|
| listName | String | Name of the WebEOC Nexus list you want to retrieve information on | True (URL) |
WebEOCList: Custom Objects
The WebEOCList type, returned when using the GetList endpoint, contains several unique, custom objects.
| 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`)
.then((response) => response.json())
C# Call
Copy Code
public async Task<WebEOCList> GetList()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var response = await httpClient.GetAsync($"{baseUrl}/lists/Shelter Status");
var data = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<WebEOCList>(data);
}
}
Related Concepts
Related Tasks