Get Resources for User Group

This API is used to fetch all the resources for a given user group.

URL: /usergroup-getResources

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 Name ** Name of the user group. 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

** - Mandatory value

Possible Response Message and Code

HTTP Code Description Response Message
200 OK Matching results found for the given input.
404 Not Found No matching records found.
400 Bad request Usergroup name cannot be empty.

Sample Request/Response

Use Case

Get all resources under the user group usergroup_1.

Request URL

https://appviewxapi.com/avxapi/usergroup-getResources?gwkey=f000ca01&gwsource=external

Request Payload
 {
 "payload": {
 "startIndex": 1,
 "maxSize": 0,
 "name": "usergroup_1"
 }
 } 
Response
 {
 "response":{
 "data":[
 {"name": " resource_0", "description": "Resource for usergroup_0", "state": "A",…},
 {"name": "resource_1", "description": " Resource for usergroup_1", "state": "A",…},
 {"name": " resource_2", "description": “Resource for usergroup_1”, "state": "A", ,…},
 {"name": " resource_3", "description": "Resource for usergroup_1", "state": "A",…}
 ],
 "totalRecords": 4,
 "obtainedRecords": 4,
 "obtainedRecordRange":{
 "start": 1,
 "end": 4
 }
 },
 "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.