Help with Filtering API Query for last_seen within 1 Day

Hi BigFix Community,

I am using the following API to query computer details:

bash

Copy code

https://server:port/api/sam/v2/computers?&token=token&criteria={"and":[["last_seen","=","2024-12-06T18:13:22Z"]]}

Currently, the criteria is filtering results based on a specific timestamp in the last_seen field. However, I want to modify this API query so that it only returns details of computers where the last_seen field is not more than 1 day old (i.e., within the last 24 hours).

Could you please help me understand how to adjust the criteria to achieve this?

Have you tried the following?

&criteria={"and":[["last_seen","last","P1D"]]}

1 Like

Here are some more example operators: Common REST API elements

1 Like