on 12-01-2020 1:59 PM
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.
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
9 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.