Querying and reading events

Hello,
I’m trying to query events on an event program. Based on the documentation, the event endpoint should return the event info and datavalues but I’m only receiving event info.
Here is the query used and the response :

https://play.dhis2.org/2.36.7/api/35/events.json?orgUnit=ImspTQPwCqd&program=lxAQ7Zs9VYR&ouMode=DESCENDANTS

events": [
    {
      "programType": "WITHOUT_REGISTRATION",
      "orgUnit": "DiszpKrYNg8",
      "program": "lxAQ7Zs9VYR",
      "event": "ohAH6BXIMad",
      "status": "ACTIVE",
      "orgUnitName": "Ngelehun CHC",
      "eventDate": "2022-04-07T00:00:00.000",
      "lastUpdated": "2018-04-12T16:05:41.933",
      "created": "2018-04-12T16:05:41.933"
    },
    {
      "programType": "WITHOUT_REGISTRATION",
      "orgUnit": "DiszpKrYNg8",
      "program": "lxAQ7Zs9VYR",
      "event": "onXW2DQHRGS",
      "status": "ACTIVE",
      "orgUnitName": "Ngelehun CHC",
      "eventDate": "2022-04-01T00:00:00.000",
      "lastUpdated": "2018-04-12T16:05:28.015",
      "created": "2018-04-12T16:05:28.015"
    }

I’m I missing something? And also it used to work before.

Hello, just found that with the new endpoint we need to specify the fields parameter.

https://play.dhis2.org/2.36.7/api/35/events.json?orgUnit=ImspTQPwCqd&program=lxAQ7Zs9VYR&ouMode=DESCENDANTS&fields=:all

4 Likes

Thanks for sharing @diallotafsir52! :+1:

1 Like