Search Organization Clients By Role Names Using POST

Search Organization Clients By Role Names Using POST

Search all clients who have at least one of the specified roles and/or resource.
Search by resource can be exact match or by resource starting with given term. At most one of the filters resource or resourceStartsWith may be provided.
For all clients found by these search criteria the result contains all clients roles, no matter if they are part of the search criteria or not.
To search by resource starting with given term provide resourceStartsWith.
If resource is empty then unscoped role assignments will be returned.
When role is provided and resource is null all role assignments will be returned.
Paginated results - by default start index of results is 1 and default number of search results per page is 15.

Access Policy

Role User Accounts Service Accounts (Client Credentials Applications)
Organization Admin ✔️
Organization Owner ✔️
Developer ✔️
Request
URI
POST
https://{api_host}/csp/gateway/am/api/orgs/{orgId}/oauth-apps/search
COPY
Path Parameters
string
orgId
Required

Unique identifier (GUID) of the organization.

Query Parameters
boolean
filterResults
Optional

Indicates if the response should be filtered by search parameters from the request: resource, resourceStartsWith and roles names (default: false).


Request Body
SearchClientsByRoleNamesRequest of type(s) application/json
Required
"SearchClientsByRoleNamesRequest Object"
string
searchType
Optional

Defines the searching capability of the "resource" field value.

Possible values are : EXACT_MATCH, CONTAINS, STARTS_WITH, ENDS_WITH,
integer As int32 As int32
pageLimit
Optional
Constraints: maximum: 15

Maximum number to return in response. Default value is 200.

string
resource
Optional
Constraints: minLength: 0 maxLength: 200

Resource to search for resource-scoped role assignments.

object
rolesSearchTerm
Optional

Defines the roles properties which are used for search.

string
resourceStartsWith
Optional
Constraints: minLength: 0 maxLength: 200

Resource to search for resource-scoped role assignments starting with given term. This field is deprecated. Consider using "resource" along with "searchType".

integer As int32 As int32
pageStart
Optional
Constraints: minimum: 1

Start index for querying. Default value is 1.

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns PagedPostResponseExpandedAuthClientDto of type(s) application/json
{
    "itemsPerPage": 25,
    "totalResults": 2000,
    "startIndex": 5,
    "results": [
        {
            "isHidden": false,
            "displayName": "string",
            "id": "string",
            "organizationRoles": [
                {
                    "displayName": "string",
                    "name": "string",
                    "expiresAt": 3609941597,
                    "createdBy": "string",
                    "lastUpdatedDate": "string",
                    "resource": "string",
                    "membershipType": "string",
                    "createdDate": "string",
                    "lastUpdatedBy": "string"
                }
            ],
            "serviceRoles": [
                {
                    "serviceRoleNames": [
                        "string"
                    ],
                    "serviceDefinitionId": "string",
                    "serviceRoles": [
                        {
                            "createdBy": "string",
                            "lastUpdatedBy": "string",
                            "name": "string",
                            "lastUpdatedDate": "string",
                            "expiresAt": 3609941597,
                            "membershipType": "string",
                            "resource": "string",
                            "createdDate": "string"
                        }
                    ]
                }
            ],
            "sourceOrg": {
                "displayName": "string",
                "orgId": "string",
                "shortId": "string"
            },
            "customRoles": [
                {
                    "createdBy": "string",
                    "lastUpdatedBy": "string",
                    "name": "string",
                    "lastUpdatedDate": "string",
                    "expiresAt": 3609941597,
                    "membershipType": "string",
                    "resource": "string",
                    "createdDate": "string"
                }
            ],
            "description": "string"
        }
    ]
}
integer As int32 As int32
itemsPerPage
Optional

Number of items per page.

integer As int32 As int32
totalResults
Optional

Total number of results if available

integer As int32 As int32
startIndex
Optional

Start index of the results.

array of object
results
Optional

Partial list of returned results.


400

Invalid request body

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


401

The user is not authorized to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


403

The user is forbidden to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


404

Organization not found

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


409

The request could not be processed due to a conflict

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


429

The user has sent too many requests

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


500

An unexpected error has occurred while processing the request

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/csp/gateway/am/api/orgs/{orgId}/oauth-apps/search