← Back to team overview

dhis2-devs team mailing list archive

DHIS-2 API's : Updating the attributes values of a specific org Unit

 

Hi,

I am using that api with json format  data to update specific attribute of
an org unit . But its create a new orgunit rather than updating the
existing org unit.
kindly explain or guide where i am wrong.

Below is the data format in json and api that iam using.
I have to update that orgunit with attribute value .

*json string data : data.json*

{"orgUnit":"o6s4YOrMS1T","name":"Muslim Medicose","shortName":"Muslim
Medicose","openingDate":"2016-09-01","attributeValues":[{"attribute":{"id":"Jn52d5llxAo"},"value":"1"}]}

*API :*

curl -X PUT -d @data.json -H "Content-Type: application/json"
-u user:password http://server/api/26/organisationUnits/o6s4YOrMS1T


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Follow ups