← Back to team overview

dhis2-devs team mailing list archive

Errors importing Events in 2.15 using the Web API (or maybe I am doing something wrong)

 

Dear Dev community

I am trying to import several events to DHIS2 (2.15) using the Web API.
This is a template of the XML file (note I am using the org. unit code for
matching):

<?xml version="1.0"?>
<event program="FurLapSaYy4" orgUnit="TZPSI_P-1563" eventDate="2014-01-01"
status="COMPLETED" storedBy="jose">
<dataValues>
<dataValue dataElement="sQdFlFQptCX" value="34"/>
<dataValue dataElement="gVqInPr2eqC" value="30-34"/>
<dataValue dataElement="hjy1KTANQbl" value="Unknown"/>
<dataValue dataElement="es3zQNdcN7d" value="4"/>
               </dataValues>
</event>

When I call the API, I get the following error: "Event.orgUnit does not
point to a valid organisation unit". So, following the documentation I
added the attribute orgUnitIdScheme="code", something like the
following: <event program="FurLapSaYy4" orgUnit="TZPSI_P-1563"
eventDate="2014-01-01" status="COMPLETED" orgUnitIdScheme="code"
storedBy="jose"> However, in this case I am getting: "HTTP Status 500 -
Unrecognized field "orgUnitIdScheme".

Also as I have to send multiple events, I am using the schema:

<?xml version="1.0"?><events>
<eventList>
<event program="FurLapSaYy4" orgUnit="TZPSI_P-1563" eventDate="2014-01-01"
status="COMPLETED" storedBy="jose">
<dataValues>
                ......

but in this case the error I got is "HTTP Status 500 - Unrecognized field
"eventList"

Am I missing something? I tried to use the Import/Export app as well, but
nothing was imported.


I am using the 2.15 with the build revision 15201

Many thanks
Jose

Follow ups