cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API - Filter Example

SOLVED
Highlighted
Regular Member

REST API - Filter Example

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: REST API - Filter Example

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.

 

View solution in original post

3 REPLIES 3
Highlighted

Re: REST API - Filter Example

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?

Tags (1)
Highlighted

Re: REST API - Filter Example

Hi,

Tks and should I use GetImplementedthingswithdata or queryimplementedthingswithdata?

What is the main difference?

Tks

Chris Vieira
Highlighted

Re: REST API - Filter Example

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.

 

View solution in original post

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!