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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

GET all data from a property based on a timestamp

dciciani
4-Participant

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

1 ACCEPTED SOLUTION

Accepted Solutions
dciciani
4-Participant
(To:amittal-3)

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

 

View solution in original post

4 REPLIES 4
amittal-3
13-Aquamarine
(To:dciciani)

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

dciciani
4-Participant
(To:amittal-3)

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

amittal-3
13-Aquamarine
(To:dciciani)

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

dciciani
4-Participant
(To:amittal-3)

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

 

Top Tags