Add a Sub Item
Use the AddSubItem call to add a sub item to any list in WebEOC Nexus. You can add sub items when you create a new list or when you update a list's name. Additionally, you can add a single sub item through the URL, if applicable.
| Description | Adds a sub item to a list in WebEOC Nexus |
|---|---|
| URL | /lists/[listname]/[listItemName]/[subItemName] |
| Method | POST |
| Parameters |
|
| Return Type | WebEOC ListItem |
| Sample JSON Response |
Copy Code
|
Review the parameter definitions and examples of how to use the AddSubItem endpoint in JavaScript and C# calls. You can either provide the [subItemName] in the URL or in the body of a request inside the WebEOCListItem object.
Parameters
| Variable Name | Type | Description | Required |
|---|---|---|---|
| listName | String | Name of the list in WebEOC Nexus to which you want to add a sub item | True (URL) |
| listItemName | String | Name of the list item in WebEOC Nexus to which you want to add a sub item | True (URL) |
| subItemName | String | Name of the sub item you want to add | True (URL) |
WebEOCListItem: Custom Objects
The WebEOCListItem, returned when using the AddSubItem endpoint, contains several unique, custom objects.
| Variable Name | Type | Description |
|---|---|---|
| name | String | Name of the list item |
| subitems | List of WebEOCListItems | Recursive list of itself |
| color | Hex color code string | Color associated with the list item |
Examples
JavaScript Call
await fetch(`${baseUrl}/lists/list01/listitem01/subitem01_Added`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then((response) => response.json())
C# Call
public async Task<WebEOCListItem> AddSubItem()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var response = await
httpClient.PostAsync($"{baseUrl}/lists/list01/listitem01/subitem01_Added", null);
var data = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<WebEOCListItem>(data);
}
}
Related Concepts
Related Tasks