Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi Team,
Please, how can we query via REST API, things like in the following scenario:
· Things are defined with Location and Temperature properties
· Customer will have an external application to query all Things temperatures from a particular location (filter things by location and retuning only temperature)
Tks,
Chris
Solved! Go to Solution.
The difference is that GetImplementingThingsWithData() returns all the Things that are part of the Thing Template that contains your service, whereas QueryImplementingThingsWithData() does the same, but only returns the Things that respect a certain query. More info on how to use queries are found here.
If it is not of any help, you can try the first method. You can iterate through all the things returned by GetImplementingThingsWithData() and return only the ones that meet certain criteria.
Hi vieirac1,
I imagine these Things with Location and Temperate properties share the same Thing Template. If so, you can create a service on the template that interrogates all the implementing Things ( using GetImplementingThingsWithData() ) and checks whether their Location property matches the Location service parameter, returning the temperature if so.
Is this the approach you're looking for?
The difference is that GetImplementingThingsWithData() returns all the Things that are part of the Thing Template that contains your service, whereas QueryImplementingThingsWithData() does the same, but only returns the Things that respect a certain query. More info on how to use queries are found here.
If it is not of any help, you can try the first method. You can iterate through all the things returned by GetImplementingThingsWithData() and return only the ones that meet certain criteria.