Forum Discussion

Tom_S-L's avatar
8 years ago

Getting Datapoint data via REST API

I've been trying to get data for individual datapoints within a single instance datasource via the REST API, in this case there are ~twenty datapoints and I only want data for one of them. Using get_data: https://www.logicmonitor.com/support/rest-api-developers-guide/data/get-data/  I can pick out my datasource, however I can't find any information on filtering by datapoint. When I get data, the datapoints are all listed in an array, then the data is presented as an array of arrays for the last hour...I could get the position of the datapoint in the first array, then pick out the data using that position for each array listed in the data but that feels like a bad road to travel. query is essentially: "resourcePath = '/device/devices/73023/devicedatasources/1573061/instances/1928726/data'"

Right now I'm adding the datapoints I want to a custom graph, I can then pull out the data for that custom graph e.g. "resourcePath = '/device/devices/73023/devicedatasources/1573061/instances/1928726/graphs/3133/data'" (with multiple lines I can pick specific data by checking the line label). Although this works fine, it still feel like an additional step.

What I'd really like is:

"resourcePath = '/device/devices/73023/devicedatasources/1573061/instances/1928726/   [datapoint/datapointID]   /data'"

but I can't see an ID for datapoints or an option for putting a 'name' in.

 

Have I missed something?

Does anyone already do this in a simple way?

  • Hi Tom,

    Thanks for posting - we should be able to add in a sub-resource for data specific to one datapoint, or at least offer a query parameter that restricts the datapoints data is returned for.  I'll get the ball rolling on that. 

    Thanks,

    Sarah