Get users and groups assigned a role

get

/apiplatform/administration/v1/roles/{roleId}/members

Returns a collection of users and groups that have been assigned the {roleId} role. By default, the name and ID of each user and group are returned. Additional fields can be returned by sending any of these field names, separated by commas, in the fields query parameter: for users, createdAt, createdBy, department, email, phone, and roles; for groups, createdAt, createdBy, department, description, email, memberCount, phone, and roles. If you send a field that applies to both users and groups (like email) the field is returned for both.

The response also contains HATEOAS links to related operations.

Users accessing this resource must be assigned the Administrator role.

Request

Supported Media Types
Path Parameters
Query Parameters
  • Collection Format: csv
    Pass optional fields, separated by commas, in this parameter to return them in the response. See the operation's description for a list of field values.
Back to Top

Response

Supported Media Types

200 Response

The role members collection.
Body ()
Root Schema : RoleMemberCollectionResponse
Match All
Show Source
Nested Schema : RoleMemberCollectionResponse-allOf[0]
Type: object
Show Source
Nested Schema : CollectionResponseFeature
Type: object
Show Source
Nested Schema : LinksResponseFeature
Type: object
Show Source
Nested Schema : items
Type: array
User and group members.
Show Source
Nested Schema : RoleMember
Type: object
A role member can be a user or group.
Show Source
Nested Schema : GroupPreview
Type: object
Show Source
Nested Schema : UserPreview
Type: object
Show Source
Nested Schema : roles
Type: array
The group's roles.
Show Source
Nested Schema : RoleCollectionItem
Type: object
Show Source
Nested Schema : roles
Type: array
The user's roles.
Show Source

400 Response

Bad request, indicates a problem with the input parameters.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

403 Response

Forbidden.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

500 Response

Unexpected error.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source
Back to Top

Examples

The following example shows how to retrieve the users and groups that have been assigned a specific role in Oracle API Platform Cloud Service by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -i -X GET 
-u apicsadmin:password
https://example.com/apiplatform/administration/v1/roles/APIManager/members

You can pass the following optional field values in the fields query parameter, separated by commas, to include them in the response:

  • createdAt: the date and time the user or group was added to the role.

  • createdBy: name of the user who added the user or group to the role.

  • department: thedepartment of the user or group

  • email: the email address of the user or group.

  • phone: the phone number of the user or group.

  • roles: an array of all roles the user or group belongs to.

  • description: a description of the group.

  • memberCount: the number of users and groups that belong to this group.

The following example shows you how to include some of these fields in the response:

curl -i -X GET 
-u apicsadmin:password
https://example.com/apiplatform/administration/v1/roles/APIManager/members?fields=email

Example of Response Headers

The following shows an example of the response headers.

HTTP/1.1 200 OK
Server: Oracle-Traffic-Director/12.2.1.0.0
Date: Mon, 02 Jan 2017 14:00:56 GMT
Content-length: 754
Content-type: application/json
X-oracle-dms-ecid: zAa9s07vR00000000
X-oracle-dms-rid: 0:1
Via: 1.1 otd_opc
Proxy-agent: Oracle-Traffic-Director/12.2.1.0.0

Example of Response Body

The following example shows the contents of the response body for a request without additional properties passed in the fields query parameter in JSON format, including information about the users and groups assigned the role and HATEOAS links to related operations.

{
  "count": 2,
  "links": [
    {
      "templated": "true",
      "method": "GET",
      "rel": "self",
      "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members"
    },
    {
      "templated": "true",
      "method": "GET",
      "rel": "canonical",
      "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members"
    }
  ],
  "items": [
    {
      "links": [
        {
          "templated": "true",
          "method": "DELETE",
          "rel": "revoke",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members/users/LCMUser"
        }
      ],
      "user": {
        "name": "LCMUser",
        "id": "LCMUser"
      }
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "DELETE",
          "rel": "revoke",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members/groups/APIManagers"
        }
      ],
      "group": {
        "name": "APIManagers",
        "id": "APIManagers"
      }
    }
  ]
}

Example of Response Body

The following example shows the contents of the response body for a request that passes the email field in the fields query parameter in JSON format, including information about the users and groups assigned the role and HATEOAS links to related operations.

{
  "count": 2,
  "links": [
    {
      "templated": "true",
      "method": "GET",
      "rel": "self",
      "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members"
    },
    {
      "templated": "true",
      "method": "GET",
      "rel": "canonical",
      "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members"
    }
  ],
  "items": [
    {
      "links": [
        {
          "templated": "true",
          "method": "DELETE",
          "rel": "revoke",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members/users/LCMUser"
        }
      ],
      "user": {
        "name": "LCMUser",
        "id": "LCMUser",
        "email": "lcmuser@example.com"
      }
    },
    {
      "links": [
        {
          "templated": "true",
          "method": "DELETE",
          "rel": "revoke",
          "href": "https://example.com:443/apiplatform/administration/v1/roles/APIManager/members/groups/APIManagers"
        }
      ],
      "group": {
        "name": "APIManagers",
        "id": "APIManagers",
        "email": "apimanagers@example.com"
      }
    }
  ]
}
Back to Top