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):
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: 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:
The id scheme must be added to the url, and not the actual payload…
···
–
Morten
On Thu, Aug 14, 2014 at 4:58 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:
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):
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: 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:
Ups… thanks Morten. Now it is working fine for one event. Thank you.
what about sending multiple events? I am still getting " HTTP Status 500 - Unrecognized field “eventList” "
···
On Thu, Aug 14, 2014 at 7:10 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi
The id scheme must be added to the url, and not the actual payload…
–
Morten
On Thu, Aug 14, 2014 at 4:58 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:
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):
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: 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:
Sorry, the xml format has changed a bit… you don’t require a eventList anymore…
You can just do:
…
…
…
···
–
Morten
On Thu, Aug 14, 2014 at 3:35 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Ups… thanks Morten. Now it is working fine for one event. Thank you.
what about sending multiple events? I am still getting " HTTP Status 500 - Unrecognized field “eventList” "
On Thu, Aug 14, 2014 at 7:10 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi
The id scheme must be added to the url, and not the actual payload…
–
Morten
On Thu, Aug 14, 2014 at 4:58 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:
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):
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: 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:
Now I get the error: HTTP Status 500 - Can not deserialize instance of java.lang.String out of START_OBJECT token
···
On Thu, Aug 14, 2014 at 10:38 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Sorry, the xml format has changed a bit… you don’t require a eventList anymore…
You can just do:
…
…
…
–
Morten
On Thu, Aug 14, 2014 at 3:35 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Ups… thanks Morten. Now it is working fine for one event. Thank you.
what about sending multiple events? I am still getting " HTTP Status 500 - Unrecognized field “eventList” "
On Thu, Aug 14, 2014 at 7:10 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi
The id scheme must be added to the url, and not the actual payload…
–
Morten
On Thu, Aug 14, 2014 at 4:58 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:
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):
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: 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:
Can you give me the full stack trace? also remember to add namespace
···
–
Morten
On Thu, Aug 14, 2014 at 3:54 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Thanks Morten,
This is the template I use
<?xml version="1.0"?>
<dataValues>
<dataValue dataElement="sQdFlFQptCX" value="34"/>
…
</dataValues>
<dataValues>
<dataValue dataElement="sQdFlFQptCX" value="20"/>
…
</dataValues>
Now I get the error: HTTP Status 500 - Can not deserialize instance of java.lang.String out of START_OBJECT token
On Thu, Aug 14, 2014 at 10:38 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Sorry, the xml format has changed a bit… you don’t require a eventList anymore…
You can just do:
…
…
…
–
Morten
On Thu, Aug 14, 2014 at 3:35 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Ups… thanks Morten. Now it is working fine for one event. Thank you.
what about sending multiple events? I am still getting " HTTP Status 500 - Unrecognized field “eventList” "
On Thu, Aug 14, 2014 at 7:10 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi
The id scheme must be added to the url, and not the actual payload…
–
Morten
On Thu, Aug 14, 2014 at 4:58 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:
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):
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: 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:
Its hard to say exactly what’s wrong here… but can you send me the file as an attachment? it is complaining about the format of the file, so there must be something there… probably something
···
–
Morten
On Thu, Aug 14, 2014 at 4:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Here it goes. Thanks. I have added the namespace with the same result.
On Fri, Aug 15, 2014 at 11:08 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi
This file is working fine in 2.16/trunk, sorry for telling you something wrong, but since you are using an old version, you do actually need the old way of doing this… which is:
…
This is due to a missing feature in the library we used for 2.15, it was fixed in 2.16 and version going forward does not require this double element
–
Morten
On Fri, Aug 15, 2014 at 4:02 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Here it goes…
We can set up an account for you in our dev server in case you need some testing.
Many thanks Morten
On Fri, Aug 15, 2014 at 10:11 AM, Morten Olav Hansen mortenoh@gmail.com wrote:
Its hard to say exactly what’s wrong here… but can you send me the file as an attachment? it is complaining about the format of the file, so there must be something there… probably something
–
Morten
On Thu, Aug 14, 2014 at 4:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:
Here it goes. Thanks. I have added the namespace with the same result.