How to get a list of users within a Tag using REST API
This guide will show you how to obtain a list of users within a Tag 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
- Tags > Get - to get a list of Tags and their IDs
- Tags > Get users - to get a list of users within a tag.
Get a list of tags
The first step is obtaining the list of Tags and their IDs. We will use those IDs later on to retrieve the users within a tag.
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}/tags to Get a list of Tags 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 Tags and their IDs of that application.
We will use from now on the ID obtained of the desired Tag
Get the users contained in a Tag
1. Click on /applications/{applicationid:int}/tags/{tagid:int}/users to get users within a tag
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 tag and their IDs