I want to ask if I want to fetch multiple data elements data from single data set having the same category combo, what should I do? DHIS2 web API won’t allow me to fetch data for data elements how i can do this any guide?
The api/dataValues endpoint is used only for individual data values; however, you can use the api/dataValueSets to fetch multiple values from the same dataset.
More details about Reading data values (you can either use a data set or a data element group) Data - DHIS2 Documentation
Thank you @Gassim yes I have read the documentation and I have used it to fetch the data for the complete dataset. But now the aim is to fetch 5 data elements data for 100 HF which entered that data on daily basis. here fetching the whole dataset is not may be very resource full.
Is there any way to fetch 5-6 data elements in the single call ?
Could you share the full API request? Are the data elements listed like this: ‘dataElement=L—5fsMdjuN;O—hCUuFt’ OR ‘dataElement=L—5fsMdjuN&dataElement=O—hCUuFt’
But there is only one dataElement mentioned? The error shows: ‘;O—hCUuFt’ where did that come from?
Please check that you have the required access rights to the data element? That the categoryCombo is the same ID as well:
/api/dataElements/LWw5fsMdjuN?fields=id,name,sharing,categoryCombo
httpStatus": “Conflict”,
“httpStatusCode”: 409,
“status”: “ERROR”,
“message”: “Data element not found or not accessible: sdkSVROyT1I,OhCUuFtRYRW20”,
“errorCode”: “E1100”
yes its typo error i am passing the correct one OhCUuFtRYRW
and yes this happen for all . as far as I am passing single data elements results were fetched but when I pass multiple I got errors
ttpStatus": “Conflict”,
“httpStatusCode”: 409,
“status”: “ERROR”,
“message”: “Data element not found or not accessible: s46m5MS0hxu,UOlfIjgN8X6co=Prlt0C1RF0s”,
“errorCode”: “E1100”
@Gassim will you please guide me here what to do next