Search for a Role

This API is used to search for a role based on the input filter condition. A role is a logical entity to group one or more Access Control Functions. The response could be one or more resource(s) matching the input.

URL: /role-search

Type: POST

Parameters

Param Type Name Description Field Type
Header sessionId** (or) Token** Use either Session Id or Token received after login. String
Query gwkey Tenant Key. Needed only in case of multi-tenant installations. String
Query gwsource** Source from which the request is triggered (for example, web, external). String
Payload filterValue Input filter value string to filter the role. String
Payload sortColumn Column by which the output has to be sorted. String
Payload startIndex Start index to show in output in case if there are more than one matching records. Integer
Payload maxSize The number of records to return in a response. maxSize is starting from the start index. Integer
Payload sortOrder The order to sort. Possible values are asc and desc. String

** - Mandatory value

Possible Response Message and Code

HTTP Code Description Response Message
200 OK Matching results found for the given input.
404 OK No matching records found.
400 Bad request Invalid sortColumn.

Sample Request/Response

Use Case

Search a role with the name Role_admin.

Request URL

https://appviewxapi.com/avxapi/role-search?gwkey=f000ca01&gwsource=external

Request Payload
 {
 "payload": {
 "startIndex" : 1,
 "maxSize" : 2,
 "sortColumn" : "name",
 "sortOrder":"asc",
 "filterValue" : "admin"
 }
 } 
Response
 {
 "response": {
 "data": [
 {
 "name": "admin",
 "description": "admin",
 "permissions": [
 "certificate:connectorActions:secureConnector",
 "certificate:settings:casettings:custom_ca",
 "certificate:settings:appsettings:view",
 "adc:dashboard:deviceheatmap:modifysettings",
 "certificate:client:adminaccess",
 "adc:deviceGroup:delete"
 ],
 "state": "A",
 "accessControlObjects": null,
 "_id": "admin",
 "_keywords": null
 }
 ],
 "totalRecords": 1,
 "obtainedRecords": 1,
 "obtainedRecordRange": {
 "start": 1,
 "end": 1
 }
 },
 "message": "Matching results found for the given input.",
 "appStatusCode": null,
 "tags": null,
 "headers": null
 } 
Note: The state of a role indicates if the resource is active or not. ‘A’ stands for active.