Edit a Sub Item

Use the EditSubItem call to revise the name or associated color of a sub item in any WebEOC Nexus list.

EditSubItem endpoint description
Description Renames or revises the color of a sub-item
URL /lists/[listname]/[listItemName]/[subItemName]
Method POST
Parameters
  • listName
  • listItemName
  • subItemName
  • name
  • color
Return Type WebEOC ListItem
Sample JSON Response
Copy Code

        {                    
            "color": null,
            "name": "List01",
            "subitems": [
                {
                    "color": null,
                    "name": "ListItem01",
                    "subitems": [
                        {
                            "color": null,
                            "name": "SubItem01_Updated"
                        }
                    ]        
                }
            ]
        }
                        

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

Parameters

EditSubItem endpoint parameters
Variable Name Type Description Required
listName String Name of the list in WebEOC Nexus to which you want to edit a sub item True (URL)
listItemName String Name of the list item in WebEOC Nexus to which you want to edit a sub item True (URL)
subItemName String Name of the sub item you want to edit True (URL)
name String New name for the sub item True
color Strings New color to associate with the sub item False

If you do not select or specify a color attribute, a color is not associated with the list item; any existing values in WebEOC Nexus are not affected.

To delete sub lists for a list item, submit in an empty sub items array.

WebEOCListItem: Custom Objects

The WebEOCListItem, returned when using the EditSubItem endpoint, contains several unique, custom objects.

Custom objects variables
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

Copy Code
var list = {
name: "SubItem01_Updated"
};
await fetch(`${baseUrl}/lists/list01/listitem01/subitem01`, { 
method: 'POST',
headers: { 'Content-Type': 'application/json' }, 
body: JSON.stringify(list)
})
.then((response) => response.json())

C# Call

Copy Code
public async Task<WebEOCListItem> EditSubItem()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var list = new
{
name = "SubItem01_Updated"
};
var serializedInformation = JsonConvert.SerializeObject(list); 
var response = await
httpClient.PostAsync($"{baseUrl}/lists/list01/listitem01/subitem01"
new StringContent(serializedInformation, Encoding.UTF8, "application/json"));
var data = await response.Content.ReadAsStringAsync(); 
return JsonConvert.DeserializeObject<WebEOCListItem>(data);
}
}