Error Posting DataValueSet payload to DHIS2 via Web API

Hi All

I’m trying to upload a dataValueSet payload to DHIS2. The payload structure is as follows:

{

  • “dataSet”:“uokZhuVwx5F”,
  • “completeDate”:“2014-06-29”,
  • “period”:“201406”,
  • “orgUnit”:“G4uL7kaWCqS”,
      • “dataElement”:“N1p2C3w2X2u”,
    • “value”:“1”,
    • “storedBy”:“Farai_Mutero”
      {}
      “dataValues”:[]
      }

The curl command I’m using to post is structured as follows:

curl -d @{local_path}\dataValues.json “http://{ip_address}/api/dataValueSets” -H “Content-Type:application/json” -u admin:district -v

I have verified the accuracy of the UIDs in the payload and they are correct. However the error message returned from DHIS2 is as follows:

{“status”:“ERROR”,“description”:“The import process failed: Failed to create statement”,“importCount”:{“imported”:0,“updated”:0,“ignored”:0,“deleted”:0}}

The DHIS2 server version I’m posting to is:

Version:
2.19
Build revision:
16781
Build date:
2015-05-18 23:21

Can someone please enlighten me on what the error may be?

Regards

···

Farai Mutero

Hi Farai,

can you please look in the tomcat log and post errors?

regards,

Lars

\

···

On Tue, Jul 14, 2015 at 3:31 PM, Farai Mutero fmutero@gmail.com wrote:

Hi All

I’m trying to upload a dataValueSet payload to DHIS2. The payload structure is as follows:

{

  • “dataSet”:“uokZhuVwx5F”,
  • “completeDate”:“2014-06-29”,
  • “period”:“201406”,
  • “orgUnit”:“G4uL7kaWCqS”,
      • “dataElement”:“N1p2C3w2X2u”,
    • “value”:“1”,
    • “storedBy”:“Farai_Mutero”
      {}
      “dataValues”:[]
      }

The curl command I’m using to post is structured as follows:

curl -d @{local_path}\dataValues.json “http://{ip_address}/api/dataValueSets” -H “Content-Type:application/json” -u admin:district -v

I have verified the accuracy of the UIDs in the payload and they are correct. However the error message returned from DHIS2 is as follows:

{“status”:“ERROR”,“description”:“The import process failed: Failed to create statement”,“importCount”:{“imported”:0,“updated”:0,“ignored”:0,“deleted”:0}}

The DHIS2 server version I’m posting to is:

Version:
2.19
Build revision:
16781
Build date:
2015-05-18 23:21

Can someone please enlighten me on what the error may be?

Regards

Farai Mutero


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org