Hello,
I’m pushing events into DHIS2 via the “/api/events” API. But, I have included multiple events in the request body in the events array, as seen below:
events =[{'program': 'WDxDNw07AX1', 'orgUnit': 'JZ7b9o5QLlr', 'eventDate': '2023-03-02', 'dataValues': [...]},
{'program': 'WDxDNw07AX1', 'orgUnit': 'JZ7b9o5QLlr', 'eventDate': '2023-03-01', 'dataValues': [...]},
{'program': 'WDxDNw07AX1', 'orgUnit': 'JZ7b9o5QLlr', 'eventDate': '2023-03-06', 'dataValues': [...]]
In the response, I receive an array that looks like this:
[{'responseType': 'ImportSummary', 'status': 'ERROR', 'importCount': {...}, 'conflicts': [...], 'reference': 'yZovJ1WJPJ5'}, {'responseType': 'ImportSummary', 'status': 'ERROR', 'importCount': {...}, 'conflicts': [...], 'reference': 'OVoPrRRYULs'}, {'responseType': 'ImportSummary', 'status': 'SUCCESS', 'importCount': {...}, 'conflicts': [...], 'reference': 'GBEP5FU3EOG', 'href': 'https://hisptz.com/southsudan/api/events/GBEP5FU3EOG'}]
Now I’m having trouble determining which events were successfully pushed from my request body and which events had errors because the return answer was not in the sequence that I had specified in the request body. So, how do I map the event from the request body to the returned response? Is there an ID or index in the API answer that I can use to map the event?