← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] API for Patch dataSet and dataelement

 

HI Ocaya for your reply.
But I got this error
{
    "httpStatus": "Conflict",
    "httpStatusCode": 409,
    "status": "ERROR",
    "message": "Only identifiable object collections can be removed from."
}

What can be issue ?

2018-04-27 20:23 GMT+00:00 Stephen Ocaya <stephocay@xxxxxxxxxxxxxx>:

> Hi, You might want to look at this documentation. This is a generic
> metadata update that you can make using the API for any metadata.
>
> You will have to prepare your payload for dataElements as below:- where id
> is UID of existing dataElements and hit the endpoints using a comand like
> below
>
> 1. Prepare the Payload
>
> {
>   "dataElements": [
>     { "id": "ID1" },
>     { "id": "ID2" },
>     { "id": "ID3" }
>   ]
> }
>
> 2. Make the Call to the Endpoints
>
> curl -d @dataelements.json "http://server/api/26/dataSets/UID/dataSetElements"; -X POST -H "Content-Type: application/json" -u user:password
>
>
>
> https://docs.dhis2.org/2.28/en/developer/html/dhis2_
> developer_manual_full.html#webapi_adding_removing_objects_collections
>
> regards
>
> On Fri, Apr 27, 2018 at 8:45 PM, Jean Habib <habibjean18@xxxxxxxxx> wrote:
>
>> Hi all,
>> Please there is a way to add dataeelement to dataset by API, like partial
>> update ?
>> Best
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> *Stephen Ocaya*
> Health Information Systems Advisor,
> Mobile: +256774558980 | +256752712007
> SkypeID: stephocay
>
>
> Strategic Information Systems for Actions
> Plot 36 Impala Avenue, Kololo
> <https://maps.google.com/?q=Plot+36+Impala+Avenue,+Kololo&entry=gmail&source=g>
> P.O. Box 4750, Kampala
>

References