Using API - do analytical values have updatedAt or createdAt dates?

Hi there!

I am very new to using DHIS2 and the API for analytics and research.

I want to pull data monthly for various dataElements. But, I want to know if there is a field in the database which says when a value was created or updated so that if I pull values for a month, I can distinguish those that were available at the last pull for example?

Hi @Megan_Beckett,
Welcome to the community! The best way to explore the API is using the URL link [instance]/api/resources

I think you’ll find this doc helpful: https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-237/metadata.html#webapi_schema

For your specific example, [instance]/api/schemas/dataElement you can see the property ‘created’

As you see the links I used above link back to the play.dhis2.org instance so that you can see live examples after you login to the instance.

Hope this helps, and good luck with your project! ( :

Hi @Megan_Beckett .

You can see the “lastUpdated” value when accessing raw, aggregate data through the “api/dataValueSets” endpoint. This information is also available through the various event/tracker endpoints and should be detailed in the documentation.

This information however is not available when accessing data through the “/api/analytics”.

Hope this helps.

Best regards,
Jason

3 Likes