Batch Assign Group Positions

Assigns multiple positions to a group in a single, idempotent call. Positions already assigned to the group are skipped (not an error). If any position name is invalid (empty/whitespace or not an existing position) the entire request fails and nothing is added. Position-name matching is case-insensitive and whitespace-trimmed; duplicate names in the payload are collapsed. An empty or missing positions array is a no-op success.

positions endpoint description
Description Assigns multiple positions to a group in a single, idempotent call.
URL
  • /groups/{groupName}/positions

  • /groups/query/batch-positions?groupName={groupName}

Method POST
Return Type BatchAssignPositionsResult
Sample request body
Copy Code
{
    "positions": ["CMD EOC Director", "Logistics Chief"]
}
Sample JSON Response
Copy Code
{
    "added": ["Logistics Chief"],
    "skipped": ["CMD EOC Director"],
    "addedCount": 1,
    "skippedCount": 1
}
Parameters
  • groupname

  • positions

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

Parameters

positions endpoint parameters
Variable Name Type Description Required
groupname String The name of the group True (URL)
positions String array the position names to assign; already-assigned names are skipped True (body)

 

Examples

JQuery Call

Copy Code
$.ajax({
    url: baseUrl + '/groups/Command/positions',
    contentType: 'application/json',
    data: JSON.stringify({ positions: ['CMD EOC Director', 'Logistics Chief'] }),
    type: 'POST'
});

C# Call

Copy Code
public BatchAssignPositionsResult AddPositionsToGroup(Cookie cookie)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseUrl + "/groups/Command/positions");
    request.Method = "POST";
    request.ContentType = "application/json";
    CookieContainer cookieJar = new CookieContainer();
    cookieJar.Add(cookie);
    request.CookieContainer = cookieJar;
    var payload = new { positions = new[] { "CMD EOC Director", "Logistics Chief" } };
    byte[] bytes = Encoding.UTF8.GetBytes(new JavaScriptSerializer().Serialize(payload));
    request.ContentLength = bytes.Length;
    using (Stream s = request.GetRequestStream()) { s.Write(bytes, 0, bytes.Length); }
    WebResponse getResponse = request.GetResponse();
    using (Stream responseStream = getResponse.GetResponseStream())
    {
        StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
        return new JavaScriptSerializer().Deserialize<BatchAssignPositionsResult>(reader.ReadToEnd());
    }
}

Errors

401, 400 (unknown/blank group, or one or more invalid position names — the message enumerates them), 500.