Error on Specifying Filters for Events API

Hello

In version DHIS2 2.36.6 and later versions I get the error Event UIDs and filters can not be specified at the same time when I specify a data element filter in the API call. This works for older versions (2.36.0 and lower). Is this due to any API changes between DHIS2 versions?

Example
Request:

https://play.dhis2.org/2.34.9/api/events?program=IpHINAT79UW&ou=DiszpKrYNg8&fields=dataValues[dataElement,value]&filter=X8zyunlgUfM:eq:Replacement

Response:

{
    "pager": {
        "page": 1,
        "pageCount": 1,
        "total": 0,
        "pageSize": 1
    },
    "events": [
        {
            "dataValues": [
                {
                    "dataElement": "X8zyunlgUfM",
                    "value": "Replacement"
                },
                {
                    "dataElement": "ebaJjqltK5N",
                    "value": "1"
                },
                {
                    "dataElement": "bx6fsa0t90x",
                    "value": "false"
                },
                {
                    "dataElement": "wQLfBvPrXqq",
                    "value": "NVP only"
                },
                {
                    "dataElement": "a3kGcGDCuk6",
                    "value": "11"
                },
                {
                    "dataElement": "UXz7xuGCEhU",
                    "value": "3843"
                }
            ]
        }
    ]
}

For 2.37.2
Request:

https://play.dhis2.org/2.37.2/api/events?program=IpHINAT79UW&ou=DiszpKrYNg8&fields=dataValues[dataElement,value]&filter=ebaJjqltK5N:eq:0&page=1

Response:

{
    "httpStatus": "Conflict",
    "httpStatusCode": 409,
    "status": "ERROR",
    "message": "Event UIDs and filters can not be specified at the same time"
}

Thank you for your question @nnkogift! I have asked for support to this and have been trying to investigate it myself as soon as I saw your post. :pray:

1 Like