Search for a Resource
This API is used to search for a resource based on input filter condition. A resource is a logical entity to group one or more ACL managed entities. The response could be one or more resource(s) matching the input.
URL: /resource-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 |
Token | access token received after login | String |
Query |
gwsource** | Source from which the request is triggered (for example, web, external) | String |
Payload |
filterValue | Input filter string value to filter the resources. | 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 sort Column |
Sample Request/Response
Use Case
Search a resource with the name Role_admin.
Request URL
https://appviewxapi.com/avxapi/resource-search?gwkey=f000ca01&gwsource=external
Request Payload
{
"payload": {
"startIndex" : 1,
"maxSize" : 3,
"sortOrder":"asc",
"sortColumn" : "name",
"filterValue" : " resource_1"
}
}
Response
{
"response": {
"data": [
{
"name": "Role_admin",
"description": "Super access will have the permissions to access all the resources in AppViewX.",
"state": "A",
"_id": " Role_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 resource indicates if the resource
is active or not. ‘A’ stands for active.