dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #10176
Re: Error Deleting TEI with WebAPI in 2.22
The confusion in adding the trackedEntity was whether it would be a child
of the trackedEntityInstance or not.
Furthermore a 3rd parameter of the Orgunit ID was required. So I was
wondering whether 'Chapter 1.53 Tracker bulk deletion' (
http://dhis2.github.io/dhis2-docs/2.22/en/developer/html/ch01s53.html)
should be updated from
{
"trackedEntityInstances": [
{ "trackedEntityInstance": "ID1" }
to
{
"trackedEntityInstances": [
{ "trackedEntity": "TE_ID1", "orgUnit":
"OU_ID1","trackedEntityInstance": "ID1" }
together with a correction in the spelling from 'trackedEntityInstasnces'
to 'trackedEntityInstances' in the curl statement that follows.
regards,
Sam Kasozi
+256 788-993-565
Skype: sam.kasoziug
On Sat, May 7, 2016 at 5:00 AM, Sam Kasozi <kasozis@xxxxxxxxx> wrote:
> Hi Alex,
>
> That is what the error message suggests, I guess the underlying question
> was the how in light of the prescribed Json format:
>
> {"trackedEntityInstances": [ { "trackedEntityInstance": "ID1" }]}
>
>
> regards,
>
> Sam Kasozi
> +256 788-993-565
> Skype: sam.kasoziug
>
> On Fri, May 6, 2016 at 8:26 PM, Alex Tumwesigye <atumwesigye@xxxxxxxxx>
> wrote:
>
>> Dear Sam,
>>
>> Please specify trackedEntity in your json.
>>
>> Alex
>>
>> On Fri, May 6, 2016 at 5:49 PM, Sam Kasozi <kasozis@xxxxxxxxx> wrote:
>>
>>> I want to delete a TEI in 2.22 with the following details
>>> (trackedEntity="XV3kldsZq0H" & trackedEntityInstance="an1MP0brTkC") using
>>>
>>> curl -X POST -d "{\"trackedEntityInstances\":
>>> [{\"trackedEntityInstance\":\"an1MP0brTkC\"}]}" -H "Content-Type:
>>> application/json" -u sam:*** "https:// ...
>>> /api/trackedEntityInstances?importStrategy=DELETE"
>>>
>>> However it returns the following Error message:
>>>
>>> {"httpStatus":"Conflict","httpStatusCode":409,"status":"ERROR","message":"An
>>> error occurred, please check import summary.",
>>>
>>> "response":{"responseType":"ImportSummary","status":"ERROR","importCount":{"imported":0,"updated":0,"ignored":1,"deleted":0},
>>> "conflicts":[{"object":"TrackedEntityInstance.trackedEntity","value":"Missing
>>> required property trackedEntity"}]}
>>>
>>> Is something wrong in the Json syntax?
>>>
>>> Regards,
>>>
>>> Sam Kasozi
>>> +256 788 993565 | Skype: sam.kasoziug
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-users
>>> Post to : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>> More help : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>>
>> --
>> Alex Tumwesigye
>>
>> Technical Advisor - DHIS2 (Consultant),
>> Ministry of Health/AFENET | HISP Uganda
>> Kampala
>> Uganda
>> +256 774149 775, + 256 759 800161
>> Skype ID: talexie
>>
>> IT Consultant (Servers, Networks and Security, Health Information Systems
>> - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant
>>
>>
>> "I don't want to be anything other than what I have been - one tree hill "
>>
>
>
Follow ups
References