Hi guys,
I’m trying to send a post request to dhis2 using the fetch implementantion in React. But i keep getting the “http 409 : only identifiable object collections can be removed from” and i dont understand what the error is about.
We are using dhsi2 to store agriculture data and here is how the endpoint is looking :
indicator
id : "something"
anotherNode : "someElse"
attributeValues : [ ]
what am trying to do is send data to the attributeValues Node. This is how my fetch request looks like :
let jsonString ={
lastUpdated: currentTime,
created: currentTime,
value: newName,
attribute: {
id : indicatorID
}
};
fetch(`https://www.namis.org/namis1/api/indicators/${id}/attributeValues`, {
body: JSON.stringify(jsonString),
headers: {
'Authorization' : basicAuth,
'Content-type': 'application/json',
},
method: 'POST'
})
.then(response => response.json());
anyone with any solutions or ideas on how to solve this error, please help me out. I’ve read the docs at: Home - DHIS2 Documentation
but am still having trouble understanding how to post my data. Please assist