← Back to team overview

dhis2-devs team mailing list archive

Changing OrgUnit of Tracked Entity Instance with WebAPI

 

Hi devs,

I'm trying to move Tracked Entity Instances using the WebAPI by updating a Tracked Entity Instance (/api/trackedEntityInstances/<id>),  but with no luck. I get it working with adding relationships, but not with changing the orgUnit. I get a success and updated: 1 in the response, but in the server nothing changes. I'm using DHIS 2.16.

example request:
{"attributes":[{"value":"Brad","displayName":"First name","attribute":"eRsJABP4maZ"},{"value":"Male","displayName":"Sex","attribute":"g8nMl2nGMjo"},{"value":"Pitt","displayName":"Surname","attribute":"imKbcSFoXYW"},{"value":"1971-07-27","displayName":"Date of birth","attribute":"jLQqopd8JQt"}],"trackedEntityInstance":"gD23tKptvsp","orgUnit":"KgKiMe4EZq3","trackedEntity":"OruGrTv39Fd","relationships":[]}

The response:
{"status":"SUCCESS","importCount":{"imported":0,"updated":1,"ignored":0,"deleted":0},"reference":"gD23tKptvsp"}

Is there something I might be doing wrong that I'm not getting?

Thanks,
Simen
 		 	   		  

Follow ups