The documentation states that file resources can be retrieved but the /api/dataValues/files endpoint doesn’t return anything. It also states that mirroring the query parameters as they would be for the data value itself. What does this mean exactly–what are the parameters?
To reproduce
- Add a “file” data element to an aggregate data set
- Upload a csv or other via the data entry app
- Query the file resource UID which is stored in the “value” property - https://play.dhis2.org/2.37.7.1/api/dataValueSets.json?dataSet=DATASET-UID&period=YYYYMM&orgUnit=OU-UID
- Request the file via https://play.dhis2.org/2.37.7.1/api/dataValues/files/FILE-RESOURCE-UID
The data value can now be retrieved as any other but the returned data will be the UID of the file resource. In order to retrieve the actual contents (meaning the file which is stored in the file resource mapped to the data value) a GET request must be made to
/api/dataValues/files
mirroring the query parameters as they would be for the data value itself. The/api/dataValues/files
endpoint only supports GET requests.