Run query with ID number: best practice

Prev Next

The quickest way to run a query using a web URL is to use the preconfigured query ID, then use the output from the web browser in other scripts or in an email.

You must have administrator permissions to run the query.

Running web API queries is quicker than running a query using the ePO - On-prem user interface. Plus, you can use their output in scripts and redirect the output and port it for further processing.

For example, to access the query New Agents Added to ePO per Week using the ePO - On-prem user interface, select MenuReportsQueries & Reports, select the New Agents Added to ePO per Week query, and click ActionsRun.

As an alternative, you can paste, https://<localHost>:8443/remote/core.executeQuery?queryId=34 in a browser address bar to display this URL output.

This web URL output is similar to the query output with the user interface, plus it allows you to use the output in another script or manipulate it as needed.

  1. Use your browser to log on to your ePO - On-prem server.

  2. To get a list of the preconfigured queries and their ID numbers, type this URL into the browser address bar, then press Enter.

    https://<localHost>:8443/remote/core.listQueries?:output=terse

  3. From the listQueries command output, find the query to run.

    In this example, the queryId=34 argument is appended to the web URL https://<localHost>/remote/core.executeQuery?queryId=<number> to run the New Agents Added to ePO per Week query.