Edit a List
Use the EditList call to rename a list in WebEOC Nexus.
| Description | Renames a list in WebEOC Nexus |
|---|---|
| URL | /lists/[listname] |
| Method | POST |
| Parameters |
|
| Return Type | WebEOCListItem |
| Sample JSON Response |
Copy Code
|
Review the parameter definitions and examples of how to use the EditList endpoint in JavaScript and C# calls.
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.
| 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);
}
}
Related Concepts
Related Tasks