Resource: Group Users ( /api/group/{id}/users )

Collection resource of users belonging to a group.

Methods

GET


Retrieves all (or a subset) of users in a group.

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.
404 - NotFoundReturned if group does not exist.

Example - Get All Users

An example of fetching all users in group.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}0832C85F-E532-472F-92E1-287995CE3726ID of the group

Response Headers

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

Response Body

[
  {
    "Id": "00000000-0000-0000-0000-000000000000",
    "UserName": "joeb",
    "Email": "joeb@unknown.net",
    "FirstName": "Joe",
    "LastName": "Bloggs",
    "Phone": "(09)-555-999",
    "LastLogIn": null,
    "Self": "http://localhost/api/user/00000000-0000-0000-0000-000000000000",
    "Links": [
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/password",
        "Rel": "ChangePassword"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Title": "Group Memberships",
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/groups",
        "Rel": "Groups"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/notifications",
        "Rel": "Notifications"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/projects",
        "Rel": "ProjectPermissions"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/mailmessages",
        "Rel": "MailMessages"
      }
    ]
  },
  {
    "Id": "00000000-0000-0000-0000-000000000000",
    "UserName": "janed",
    "Email": "janed@unknown.net",
    "FirstName": "Jane",
    "LastName": "Doe",
    "Phone": "(09)-555-999",
    "LastLogIn": null,
    "Self": "http://localhost/api/user/00000000-0000-0000-0000-000000000000",
    "Links": [
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/password",
        "Rel": "ChangePassword"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Title": "Group Memberships",
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/groups",
        "Rel": "Groups"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/notifications",
        "Rel": "Notifications"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/projects",
        "Rel": "ProjectPermissions"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/mailmessages",
        "Rel": "MailMessages"
      }
    ]
  }
]

Status Code

200 - OK

Example - Get Users filtered by first name

An example of fetching a set of users by first name belonging to the group, by using the ODATA $filter query parameter.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}0832C85F-E532-472F-92E1-287995CE3726ID of the group
$filterFirstName eq 'Jane'The ODATA $filter parameter, this query parameter should be url encoded i.e. $filter=FirstName%20eq%20'Jane'.

Response Headers

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

Response Body

[
  {
    "Id": "00000000-0000-0000-0000-000000000000",
    "UserName": "janed",
    "Email": "janed@unknown.net",
    "FirstName": "Jane",
    "LastName": "Doe",
    "Phone": "(09)-555-999",
    "LastLogIn": null,
    "Self": "http://localhost/api/user/00000000-0000-0000-0000-000000000000",
    "Links": [
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/password",
        "Rel": "ChangePassword"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Title": "Group Memberships",
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/groups",
        "Rel": "Groups"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/notifications",
        "Rel": "Notifications"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/projects",
        "Rel": "ProjectPermissions"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/mailmessages",
        "Rel": "MailMessages"
      }
    ]
  }
]

Status Code

200 - OK

PUT


Sets the users that are members of the group.

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.
404 - NotFoundReturned if group does not exist.

Example - Set Members

Sets the users who are members of this group.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}0832C85F-E532-472F-92E1-287995CE3726ID of the group

Request Body

{
  "Items": [
    {
      "Id": "00000000-0000-0000-0000-000000000000"
    },
    {
      "Id": "00000000-0000-0000-0000-000000000000"
    }
  ]
}

Response Headers

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

Response Body

[
  {
    "Id": "00000000-0000-0000-0000-000000000000",
    "UserName": "joeb",
    "Email": "joeb@unknown.net",
    "FirstName": "Joe",
    "LastName": "Bloggs",
    "Phone": "(09)-555-999",
    "LastLogIn": null,
    "Self": "http://localhost/api/user/00000000-0000-0000-0000-000000000000",
    "Links": [
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/password",
        "Rel": "ChangePassword"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Title": "Group Memberships",
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/groups",
        "Rel": "Groups"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/notifications",
        "Rel": "Notifications"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/projects",
        "Rel": "ProjectPermissions"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/mailmessages",
        "Rel": "MailMessages"
      }
    ]
  },
  {
    "Id": "00000000-0000-0000-0000-000000000000",
    "UserName": "janed",
    "Email": "janed@unknown.net",
    "FirstName": "Jane",
    "LastName": "Doe",
    "Phone": "(09)-555-999",
    "LastLogIn": null,
    "Self": "http://localhost/api/user/00000000-0000-0000-0000-000000000000",
    "Links": [
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/password",
        "Rel": "ChangePassword"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/global",
        "Rel": "GlobalPermissions"
      },
      {
        "Title": "Group Memberships",
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/groups",
        "Rel": "Groups"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/notifications",
        "Rel": "Notifications"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/permissions/projects",
        "Rel": "ProjectPermissions"
      },
      {
        "Href": "http://localhost/api/user/00000000-0000-0000-0000-000000000000/mailmessages",
        "Rel": "MailMessages"
      }
    ]
  }
]

Status Code

200 - OK

  • No labels