Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
646 views

Rest API - Querying for users modified

Hello,

Can some share how to query for users who have been modified from a certain date using the timeLastMod attribute, something to the effect of 

GET https://gwserver:9710/list/user?timeLastMod>600790683000

Is there such a uri that can be used?

Thanks.

Labels (1)
0 Likes
5 Replies
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

There are a couple of options to specify time formats. It can be done using milliseconds:

Get all users that have a last modified time after millisecond value 1600822800000 (ie. September 23, 2020 1:00:00 AM)
curl -k -u <admin name>:<admin password> "https://<admin service IP address>:<admin service port>/gwadmin-service/list/USER?filter=timeLastMod%20gt%20'1600822800000'"

or it can be done using human-readable date and time:

Get all users that have a last modified time after September 23, 2020 1:00:00 AM
curl -k -u <admin name>:<admin password> "https://<admin service IP address>:<admin service port>/gwadmin-service/list/USER?filter=timeLastMod%20gt%20'2020-09-23T01:00:00'"

where the human-readable time is formatted YYYY-MM-DDThh:mm:ss. The operators should be lt, eq, gt.

Hope that helps!

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Thanks that worked!

Can a filter be applied to other calls? What I am trying to achieve is also filtering modifications to Groups that have occured.

Thanks. 

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

You can do the same thing with all Group objects by USER to GROUP, or you can get all Group Membership changes by changing USER to GROUP_MEMBER. You can also filter Group Memberships for a specific Group with

curl -k -u <admin name>:<admin password> "https://<admin service IP address>:<admin service port>/gwadmin-service/domains/<domain name>/postoffices/<post office name>/groups/<group name>/members?filter=timeLastMod%20gt%20'2020-09-23T01:00:00'"

Is that what you were looking for?

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Exactly what I was looking for. Awesome, thanks!

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Hi @sbhanji

if you like Dave's reply and even got a solution, do not forget to show it! So it's easier to get the right information in case of searches.

Diethmar Rimser
This community is more powerful if you use Likes and Solutions
Diethmar Rimser
This community is more powerful if you use Likes and Solutions
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.