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.
| Description | Assigns multiple positions to a group in a single, idempotent call. |
|---|---|
| URL |
|
| Method | POST |
| Return Type | BatchAssignPositionsResult |
| Sample request body |
Copy Code
|
| Sample JSON Response |
Copy Code
|
| Parameters |
|
Review the parameter definitions and examples of how to use the positions endpoint in JQuery and C# calls.
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
$.ajax({
url: baseUrl + '/groups/Command/positions',
contentType: 'application/json',
data: JSON.stringify({ positions: ['CMD EOC Director', 'Logistics Chief'] }),
type: 'POST'
});
C# Call
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.