How to get a list of users within a Group using REST API
This guide will show you how to obtain a list of users within a Group using REST API.
Requisites
The Commands REST API resource requires the following information when using it:
- Read how to enable REST API
- Read how to generate the REST API token
- Read how to obtain an application ID
Resources used
- Groups > Get - to get a list of Groups and their IDs
- Groups > Get users - to get a list of users within a Group.
Get a list of Groups
The first step is obtaining the list of Groups and their IDs. We will use those IDs later on to retrieve the users within a Group.
1. Log in to http://host_name/comGpsGate/api/v.1/test
Note: replace host_name with your actual server IP address or DNS name.
2. Click on the resource name /applications/{applicationid:int}/Groups to Get a list of Groups and click on > Try it out option.
3. Enter the following details:
- applicationid = the ID of the application. Read here how to obtain it.
4. Click on Execute
Under the Response area, you should be able to see the Groups and their IDs of that application.
We will use from now on the ID obtained of the desired Group
Get the users contained in a Group
1. Click on /applications/{applicationid:int}/Groups /{tagid:int}/users to get users within a Group
Click on > Try it out option.
2. Enter the following details:
- applicationid = the ID of the application. Read here how to obtain it.
- tagid = the ID obtained in the previous step.
3. Click on Execute
Under the response area, you will see the users contained within that Group and their IDs