Resource: Groups ( /api/groups )

Allows the search and retrieval of groups.

Root Relation: Groups

Methods

GET


Retrieves all (or a subset) of groups.

This method supports the OData parameters $filter, $top, $take, $orderby and $inlinecount. See OData Topic for more details.

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.

Example - Get All Groups

An example of fetching all groups.

Request Headers

KeyValueDescription
Acceptapplication/json

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

[
  {
    "Id": "9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Name": "Admins",
    "Description": "System Administrators",
    "Self": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Links": [
      {
        "Title": "Members",
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/users",
        "Rel": "Users"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/projects",
        "Rel": "ProjectPermissions"
      }
    ]
  },
  {
    "Id": "9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Name": "QA",
    "Description": "QA Team (Testers + Test Managers)",
    "Self": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Links": [
      {
        "Title": "Members",
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/users",
        "Rel": "Users"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/projects",
        "Rel": "ProjectPermissions"
      }
    ]
  }
]

Status Code

200 - OK

Example - Get Groups filtered by group name

An example of fetching a set of groups filtered by name, by using the ODATA $filter query parameter.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
$filterName eq 'QA'The ODATA $filter parameter, this query parameter should be url encoded i.e. $filter=Name%20eq%20'QA' .

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

[
  {
    "Id": "9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Name": "QA",
    "Description": "QA Team (Testers + Test Managers)",
    "Self": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d",
    "Links": [
      {
        "Title": "Members",
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/users",
        "Rel": "Users"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/projects",
        "Rel": "ProjectPermissions"
      }
    ]
  }
]

Status Code

200 - OK

POST


Create a new group

Required Permissions

  • Administration/Organisation/ManageUserAndGroupSecurity

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if request contained invalid data or would cause a conflict with an existing group record.
404 - NotFoundReturned if group does not exists.

Example - Create new group

Create a new group.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Body

{
  "Id": null,
  "Name": "QA",
  "Description": "QA Team (Testers + Test Managers)"
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8
Locationhttp://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d

Response Body

{
  "Id": "9e1ee34b-f96f-4005-9f7a-1457df86256d",
  "Name": "QA",
  "Description": "QA Team (Testers + Test Managers)",
  "Self": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d",
  "Links": [
    {
      "Title": "Members",
      "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/users",
      "Rel": "Users"
    },
    {
      "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/global",
      "Rel": "GlobalPermissions"
    },
    {
      "Href": "http://localhost/api/group/9e1ee34b-f96f-4005-9f7a-1457df86256d/permissions/projects",
      "Rel": "ProjectPermissions"
    }
  ]
}

Status Code

201 - Created

  • No labels