Check what can be done with user groups
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.roundrobinbot.eu/v1/user-groups/capabilities"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.roundrobinbot.eu/v1/user-groups/capabilities"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.roundrobinbot.eu/v1/user-groups/capabilities") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://api.roundrobinbot.eu/v1/user-groups/capabilities', headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.roundrobinbot.eu/v1/user-groups/capabilities';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.roundrobinbot.eu/v1/user-groups/capabilities \ --header 'Authorization: Bearer <token>'Ask before binding a group to a rotation. Binding is the one write whose success depends on something outside Round Robin: user groups are a paid Slack feature, and a workspace or its org can keep their administration above what the app is allowed to do. canCreate answers whether a group can be made here, which is what sending a handle asks for. canModify answers whether membership can be changed at all, and is null when it could not be established rather than false, because a workspace with no group to try it on cannot answer. Add ?userGroupId=S… to ask about one group as well. That is a different question: a group owned by another workspace in the same org can be unmanageable while groups in general are fine.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”OK
What this workspace lets Round Robin do with Slack user groups, and optionally whether one particular group can be managed.
object
Whether Round Robin can make a new user group in this workspace, which is what handle asks for.
Whether Round Robin can change the membership of a user group here. Null when it could not be established, which is not the same as no: a workspace with no group to try it on cannot answer.
The answer for the group named in ?userGroupId=, and absent when none was.
object
The group that was checked.
Whether binding this group would be accepted.
Slack’s reason when it would not, such as permission_denied, and null when it would.
Examplegenerated
{ "canCreate": true, "canModify": true, "checked": { "id": "example", "manageable": true, "reason": "example" }}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}