Importing Entity data versioning history via oData feed

1. What is the issue? Please be detailed.
How we can get versioning history of entity updates through oData feed?
Eg. I want to record reservoir head level as an entity and update it via multiple forms. Then I need to import data to plot a time series graph. I'm able to see update history with time stamps in odk central. But I'm struggling to import edit history via oData feed.

2. What steps can we take to reproduce this issue?
N/A

3. What have you tried to fix the issue?
N/A

4. Upload any forms or screenshots you can share publicly below.
N/A

Hey @upulpp ! A heartfelt welcome to the ODK community! Whenever you find a moment, feel free to introduce yourself here - we'd love to get to know you better and hear your story! :sparkles:

Now, about your question: I am not sure if OData Endpoints directly supports retrieving the version history of specific (or multiple) entity records, but don't worry - there's a way! ODK Central's REST API is your go-to for this. With the API, you can fetch the history (versions), compare differences, or even review the audit log of an entity record.

Here's how you can do it:

:one: To get the version history (all changes over time) for an entity record (by UUID):

[GET] {{base_url}}/v1/projects/{{project_id}}/datasets/{{entity_name}}/entities/{{entity_uuid}}/versions

:two: To compare differences between versions of an entity record:

[GET] {{base_url}}/v1/projects/{{project_id}}/datasets/{{entity_name}}/entities/{{entity_uuid}}/diffs

:three: To check the audit log (who did what and when) for an entity record:

[GET] {{base_url}}/v1/projects/{{project_id}}/datasets/{{entity_name}}/entities/{{entity_uuid}}/audits

All these endpoints return JSON responses to make your data retrieval straightforward and flexible.

Wishing you a fantastic day ahead and a very happy new year in advance! :tada::sparkles:

4 Likes

Thank you!
This helps a lot.

1 Like