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

GET all data from a property based on a timestamp

Highlighted
Level 4

GET all data from a property based on a timestamp

Hi everyone,

 

there is a GET call to retrieve all data collected from a property of a Thing, in json format?

It's also possible specify a timestamp and retrieve all the data since that period

 

Thanks,

Daniele

4 REPLIES

Re: GET all data from a property based on a timestamp

Hi Daniele,

You can try using the service "QueryPropertyHistory", to get the values of all the logged params/properties of your thing. This service takes start date and end date as its input parameters.

If you want to get the values of a particular property which is of number type you can use "QueryNumberPropertyHistory". This service takes the property name of a thing as input as well as start and end date. There are similar services for other types of properties as well like - 

"QueryBooleanPropertyHistory",

"QueryDateTimePropertyHistory",

"QueryImagePropertyHistory"..etc.

You can find these services in the Services -> Generic Services section for a Thing.

I hope this helps. Please let me know in case if any other details are needed.

Thanks

Aditya Mittal

Re: GET all data from a property based on a timestamp

Hi Aditya,

 

thanks for your response.

 

So assuming that I have:

- a thing call  "myThing"

- a property call "Speed" (Number)

how will be the Rest get call?

I'm thinking something like this: 

https://<ServerName>/Thingworx/Things/myThing/Property/Speed/QueryPropertyHistory/

 

Thanks,

Daniele

Re: GET all data from a property based on a timestamp

Hello Daniele,

Regarding the Rest API call, I am not so sure about it. Probably you might have to wait untill someone else replies on your query.

-Aditya

Re: GET all data from a property based on a timestamp

Hello Aditya,

 

thanks, anywayI found the solution and I post here for those who will read the post:

The solution is make a POST like this:

https://<ServerName>Thingworx/Things/myThing/Services/QueryNumberPropertyHistory?propertyName=Speed

 

Dont' forget the securty key and content type.

 

Daniele