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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Data bindings with Java-programmed things

fsiviero
7-Bedrock

Data bindings with Java-programmed things

Hi,

We are building an Extension and would like to see snippets or examples of the data bindings required for the Extension to get, for example, historic information of one data item.

3 REPLIES 3
danme
10-Marble
(To:fsiviero)

Hi Fransisco,

In order to access property history you will need to have set up a stream or a value stream on your thing itself from the platform end. This will happen after you create a thing based on your extension thing template. Assuming this is set up properly, you can then execute the following command to get the property history:

General property search:

thingName.QueryPropertyHistory(maxItems(double), startDate(Datetime), endDate(Datetime), oldestFirst(Boolean), query(JSON));

if you want to get a specific property, then you can use  more narrow search:

ex.

thingName.QueryStringPropertyHistory(maxItems(double), propertyName(String), startDate(Datetime), endDate(Datetime), oldestFirst(Boolean), query(JSON));


or


thingName.QueryBooleanPropertyHistory(maxItems(double), propertyName(Boolean), startDate(Datetime), endDate(Datetime), oldestFirst(Boolean), query(JSON));

fsiviero
7-Bedrock
(To:danme)

Thank you for your answer. How would I access the same data from the REST API instead? Would it be something like: http://localhost/Thingworx/Things/<thing>/QueryPropertyHistory ?

danme
10-Marble
(To:fsiviero)

Close, it should be

Http://Thingworx/Things/<thing>/Services/QueryPropertyHistory

Announcements


Top Tags