Api post

I want to post an event data from customized data entry to a program. The payload I created can be imported without any error from Import/Export module but when I try with Ajax post I get the error of 409. I am new to dhis2 api any workaround for it will be much appreciated.

dhis v2.29
built: aaa0fff
tomcat: 8.5.5

               var JsonData = {

“program”: “RxSPAmxTSAd”,
“orgUnit”: “KFDA4CZjN4u”,
“eventDate”: “2019-03-02”,
“status”: “COMPLETED”,
“completedDate”: “2019-03-03”,
“storedBy”: “admin”,
“dataValues”: [
{ “dataElement”: “mGWhRWsdmZ9”, “value”: “CCHF” },
{ “dataElement”: “tNE7jZcgb0u”, “value”: “50” },
{ “dataElement”: “vyyVRZxgHpm”, “value”: “Year” },
{ “dataElement”: “thiap9ppCi8”, “value”: “Name of Deceased” },
{ “dataElement”: “NrrpsQVus6n”, “value”: “Male” },
{ “dataElement”: “NpX4DNHR2Yp”, “value”: “Resident of Deceased” },
{ “dataElement”: “BXGD7swtE2h”, “value”: “None” }

        url: '',
        type: 'POST',
        dataType : "json",
        data: JsonData,
        contentType: "application/json",
        success: function(data){
        error: function(data){

@mujtabaomar Essai de modifier l’objet “data : JsonData” par “data : JSON.stringify(JsonData)”

1 Like