Forum Discussion

MrJ's avatar
5 years ago
Solved

Querying alerts via API

Hi I'm fairly new to APIs and would like a little help please. I am trying to query the LM API for specific alerts with Python. I am able to retrieve a full list of alerts via Python which is...
  • Anonymous's avatar
    Anonymous
    5 years ago
    48 minutes ago, MrJ said:

    For the v2 API, does it display the data any different or is the only difference no support for basic auth?

    The data structure changes for v2 and some of the endpoints are different. Some more info here. The v2 REST documentation is here: https://www.logicmonitor.com/swagger-ui-master/dist/#/Alerts/getAlertList, but the filtering shouldn't be any different.

    As far as why it's not working (meaning you're getting an http 200 but not filtered results), I am wondering if the filter can only affect those fields included in the response. That being the case, can you filter based on the value of `monitorObjectGroups`? Unfortunately, being end of quarter, I don't have the time to run any tests to figure out what works.