PUT /api/resources/{ResourceID}/roles/{RoleName}/members

Updates information about the groups and users assigned to the specified platform role.

  • Groups: Assign or update the groups for a domain such as LDAP and SAML for a platform role.

  • Users: Assign or update the users for a domain such as LDAP and SAML for a platform role.

The multiple groups or users can be assigned at a time. A user can be registered with a single tenant. You cannot assign a role to a user already registered with another tenant.

Note: You can assign users that do not exist in the Akana Platform. In case of an LDAP domain to assign a user that does not exist, use LDAP userName in the request body to create a new user. Similarly, in the case of the SAML domain to assign a user that does not exist, use a user email address in the request body to create a new user.

Authorization Roles/Permissions: Must have permission to modify the resource. Generally, a Business Admin, Site Admin, and the user having read or modify access to the tenant business and organization.

This topic includes the following sections:

HTTP Method

PUT

URL

https://{hostname}/api/resources/{ResourceID}/roles/{RoleName}/members

Sample Request

The example below shows a request to add the specified user and a group, defined in the request body, to the resource defined in the path parameter.

Sample Request URL

https://{hostname}/api/resources/tenantbusiness.acmepaymentscorp/roles/API Administrator/members

Sample request headers

Accept: application/json
Content-Type: application/json
Connection: Keep-Alive
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

{
   "users": [
       {
          "userID": "all-admin-direct-ldap-user-01",
          "userName": "all-admin-direct-ldap-user-01", 
          "fullName": "Jonathan Swift",
          "domainName": "LDAP"
       },
	{
          "userID": "5cec4d53-bbe2-4166-916b-a47a7277f7e7.acmepaymentscorp",
          "userName": "5cec4d53-bbe2-4166-916b-a47a7277f7e7.acmepaymentscorp", 
          "fullName": "Mark Douglas",
          "domainName": "Local Domain"	
	}	
   ],
   "groups": [
       {   
          "groupName": "CustomRole",
          "domainName": "LDAP"
       },
       {
          "groupName": "CustomRole",
          "domainName": "SAML"
       }
   ]
}

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept

application/json

Content-Type

application/json

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
ResourceID Path string Required

The unique ID for a specific resource. In this context, it is the BusinessID of a tenant or its child organization.

RoleName Path String Required The name of a security role defined in the API platform.

Response

If successful, this operation returns HTTP status code 200, and the specified user and group is assigned to the specified role.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/json

Content-Type: application/json
Accept: application/json
Date Mon, 02 Aug 2023 18:48:28 GMT

Sample response body: application/json

[
    {
        "roleName": "API Administrator",
        "resourceID": "tenantbusiness.acmepaymentscorp",
        "users": [
          {
            "userID": "all-admin-direct-ldap-user-01",
            "userName": "all-admin-direct-ldap-user-01",
            "domainName": "LDAP", 
            "fullName": "Jonathan Swift"
          },
          {
            "userID" : "5cec4d53-bbe2-4166-916b-a47a7277f7e7.acmepaymentscorp",
            "userName" : "5cec4d53-bbe2-4166-916b-a47a7277f7e7.acmepaymentscorp",
            "domainName" : "Local Domain",
            "fullName" : "Mark Douglas"
          }
    ],
        "groups": [
          {
            "groupName": "CustomRole",
            "domainName": "LDAP"
          },
          {
            "groupName": "CustomRole",
            "domainName": "SAML"
          }
    ],
    {
    "Link": {
      "rel": "self",
      "href": "http://acmepaymentscorp.com/api/resources/tenantbusiness.acmepaymentscorp/roles/API Administrator/members"
    }
 }
]

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type

application/json

Response Body

Name Description
roleName The name of a security role defined in the API platform.
resourceID The unique ID for a specific resource.
userID The user ID of a user on the platform.
userName The username for the group member.
domainName The domain name indicates the name of the domain the user signed in with.
fullName The full name of a user.
groupName The name of a group.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
400 Bad request: Returned if the client sends a malformed request; for example, invalid parameters or body content. For example, you might get this response if you didn't include the required headers.
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
404 The resource could not be found.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.