Patch a Group

Partially updates a group. Only the fields included in the request body are changed; omitted fields are left untouched. Optionally include an If-Match request header (set to the ETag value returned by a prior Get group call) to guard against concurrent modification. If the group has changed since that read, the service responds with 412 Precondition Failed and makes no change.

groupName endpoint description
Description Partially updates a group.
URL
  • /groups/{groupName}

  • /groups/query?groupName={groupName}

Method PATCH
Parameters
  • groupName

  • name

  • comment

  • organizational

  • assignedPositions

  • assignedIncidents

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

Parameters

groupName endpoint parameters
Variable Name Type Description Required
groupname String Name of the WebEOC Nexus group to patch True (URL)
name String New name of the WebEOC Nexus group. Omit to keep the existing name. False
comment String New comments. Omit to keep the existing comments. False
organizational String
  • True if the group may have process permissions

  • False if the group will not have process permissions

Omit to keep current setting.

False
assignedPositions String array Replacement position list Omit to keep existing list. False
assignedIncidents String array Replacement incident list Omit to keep existing list. False

Unassigned parameters will not be edited or changed.

Examples

JQuery Call

Copy Code
$.ajax({
    url: baseUrl + '/groups/Command',
    contentType: 'application/json',
    headers: { 'If-Match': etagFromPriorGet },
    data: JSON.stringify({ 'comments': 'Updated command group' }),
    type: 'PATCH'
});

C# Call

Copy Code
public void PatchGroup(Cookie cookie, string etag)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseUrl + "/groups/Command");
    request.Method = "PATCH";
    request.ContentType = "application/json";
    if (!string.IsNullOrEmpty(etag)) request.Headers["If-Match"] = etag;
    CookieContainer cookieJar = new CookieContainer();
    cookieJar.Add(cookie);
    request.CookieContainer = cookieJar;
    byte[] bytes = Encoding.UTF8.GetBytes(new JavaScriptSerializer().Serialize(new { comments = "Updated command group" }));
    request.ContentLength = bytes.Length;
    using (Stream s = request.GetRequestStream()) { s.Write(bytes, 0, bytes.Length); }
    request.GetResponse();
}

Errors

401, 400 (blank or unknown group, or insufficient permissions), 412 (If-Match mismatch), 500.

As of WebEOC Nexus 10.20 and later, Get Group also returns a processPermissions array (each entry has a name and its assignedGroups) and an ETag header for use with this operation.