cancel
Showing results for 
Search instead for 
Did you mean: 

Thing last update timestamp

david_sooter2
Explorer

I have a small question. I am trying to get a timestamp for the last time Timeseries Data have been sent for all my things. And am trying for figure out the best way to do it.

I know I can read the snapshot data and extract it from there, but I would then have to read a snapshot for all my thing and I don’t really thing this is the most efficient way.

I notice in the documentation (see link) that I can pass a header ‘sap-iot-issync’ and it should (as far as I can understand) return the latest data creation timestamp for a thing (which is exactly what I need) in the documentation it all looks wonderful but when I call the service the field is always null.

https://help.sap.com/viewer/fffd6ca18e374c2e80688dab5c31527f/2011b/en-US/a8911e8f148b4185a7b22ea2d4b...

So my question is am I do it wrong? Is I broken? Or did I misunderstand the purpose of this field? Or is there a better way?

Accepted Solutions (1)

Accepted Solutions (1)

harry_lube
Advisor
Advisor

Hello David,

let me complement Jan's response and make you understand how to leverage the "issync" feature you were looking at.

Before being able to read the "SyncedTimestamp", you will need to initiate its activation. This is not done automatically. You can trigger the timestamp to be set when adding the header parameter to the REST API to write time series data for a thing. See https://help.sap.com/viewer/fffd6ca18e374c2e80688dab5c31527f/2011b/en-US/a71c33f350d543429420611b37d...

If you want to enable the same for data being ingested via device connectivity and ingestion pipeline, please create a ticket for component IOT-BSV-TS and request to have your tenant configured to support the exposure of the "SyncedTimestamp".

Best regards,

Harry

david_sooter2
Explorer
0 Kudos

thank you. Created a Ticket lets see if they can get it working

Answers (1)

Answers (1)

former_member232287
Active Participant
0 Kudos

Hi David,

If I understood your query correctly you should be able to use this API: https://help.sap.com/viewer/fffd6ca18e374c2e80688dab5c31527f/2011b/en-US/4889f896a14749d581db25666e5...

You can do a request like this:

/<property set type name>/aggregates?$select=id,time,<yourproperty>_TLAST&$filter=time ge datetime'<timestamp in the past depending on the frequency your things are usually sending data>' and time lt datetime'<now>'&$top=1

This should be sufficient for your needs and return the last send value for your selected Thing Type and Property Set Type.

Regards

Jan

david_sooter2
Explorer
0 Kudos

Hi Jan,

Thank your for the response. I could do that but then i would have to go over all property sets and properties for a Thing to find out when the Thing last recieved data. That would end up being a lot of calls.

What i am looking for is the possibility to see when data was last sent for a thing regadless of which property set it was sent to. That way i can quickly see if this particular thing is recieving data.

Thanks

former_member232287
Active Participant
0 Kudos

Do you need the last data point per Thing or for all your things?

david_sooter2
Explorer
0 Kudos

id like both but I'd settle for either atm 🙂