Edit a List

Use the EditList call to rename a list in WebEOC Nexus.

EditList endpoint description
Description Renames a list in WebEOC Nexus
URL /lists/[listname]
Method POST
Parameters
  • listName
  • name
Return Type WebEOCListItem
Sample JSON Response
Copy Code
{
"color": null,
"name": "List01_Updated",
"subitems": []
}

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

Parameters

EditList endpoint parameters
Variable Name Type Description Required
listName String Name of the list in WebEOC Nexus True (URL)
name String New name for the list True

WebEOCList: Custom Objects

The WebEOCList, returned when using the EditList endpoint, contains several unique, custom objects.

Custom objects members
Member 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: "List01_Updated"
};
await fetch(`${baseUrl}/lists/List01`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' }, 
body: JSON.stringify(list)
})
.then((response) => response.json())

C# Call

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