dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28319
Re: Update person
Hi,
What is the standing on this one? It still works fine on my side.
Adding/updating new persons. Are you still struggling with the format?
I'm adding one more example, which you should be able to use to create a
new person on our demo server.
curl -v -X POST -d @person.json -H "Content-Type: application/json" -u
admin:district http://apps.dhis2.org/demo/api/persons
We will update the documentation, but we are in the process of changing the
whole tracker/person web-api, so it will have to wait until the refactor is
done..
--
Morten
On Mon, Feb 24, 2014 at 3:38 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>wrote:
> This should now have been fixed in rev 13788 or 2.14, please try it again.
> If you download from our CI servers, please allow 45 - 60 minutes before
> downloading.
>
> --
> Morten
>
>
> On Mon, Feb 24, 2014 at 3:28 PM, Pascal Brandt <pascal@xxxxxxxxx> wrote:
>
>> Thanks for your help Morten.
>>
>> Cheers,
>> Pascal
>>
>>
>>
>> On 24 February 2014 10:26, Morten Olav Hansen <mortenoh@xxxxxxxxx> wrote:
>>
>>> Hi Pierre
>>>
>>> I think I have located the issue. We have something called program
>>> identifiers/attributes which are not supported by the person API yet. At
>>> the same time, the API doesn't recognize that the identifier/attribute
>>> shouldn't be mandatory in your case (since you are creating a person only,
>>> not enrolling to a program)
>>>
>>> I will try to provide a fix today
>>>
>>> --
>>> Morten
>>>
>>>
>>> On Mon, Feb 24, 2014 at 1:56 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>wrote:
>>>
>>>> I will provide you with an example soon
>>>>
>>>> --
>>>> Morten
>>>>
>>>>
>>>> On Mon, Feb 24, 2014 at 1:24 PM, Pierre Dane <pierre@xxxxxxxxx> wrote:
>>>>
>>>>> Hi Morten,
>>>>>
>>>>> I’m sure this is just a documentation issue - I’ve tried playing with
>>>>> the format of the json and nothing seems to work.
>>>>>
>>>>> If you could send me a test json message that works in demo
>>>>> environment that might help.
>>>>>
>>>>> I’m running revision 13776. Just to make sure you see my problem I’ll
>>>>> paste it again below:
>>>>> Message:
>>>>> {
>>>>> "orgUnit": "C33j9neHDGt",
>>>>> "identifiers": [ {
>>>>> "type": "zEhQmZeoRN9",
>>>>> "value": "7373736543376"
>>>>> } ],
>>>>> "attributes": [ {
>>>>> "type": "uRGeJ84LKb5",
>>>>> "value": "pierretest"
>>>>> },{
>>>>> "type": "PGtWVaM3uXz",
>>>>> "value": "2010-02-02"
>>>>> },{
>>>>> "type": "T7pwpMdaVVa",
>>>>> "value": "1974-02-03"
>>>>> }
>>>>> ]
>>>>> }
>>>>>
>>>>> 0000: 7B 22 73 74 61 74 75 73 22 3A 22 45 52 52 4F 52 |
>>>>> {"status":"ERROR |
>>>>> 0010: 22 2C 22 69 6D 70 6F 72 74 43 6F 75 6E 74 22 3A |
>>>>> ","importCount": |
>>>>> 0020: 7B 22 69 6D 70 6F 72 74 65 64 22 3A 30 2C 22 75 |
>>>>> {"imported":0,"u |
>>>>> 0030: 70 64 61 74 65 64 22 3A 30 2C 22 69 67 6E 6F 72 |
>>>>> pdated":0,"ignor |
>>>>> 0040: 65 64 22 3A 31 2C 22 64 65 6C 65 74 65 64 22 3A |
>>>>> ed":1,"deleted": |
>>>>> 0050: 30 7D 2C 22 63 6F 6E 66 6C 69 63 74 73 22 3A 5B |
>>>>> 0},"conflicts":[ |
>>>>> 0060: 7B 22 6F 62 6A 65 63 74 22 3A 22 49 64 65 6E 74 |
>>>>> {"object":"Ident |
>>>>> 0070: 69 66 69 65 72 2E 74 79 70 65 22 2C 22 76 61 6C |
>>>>> ifier.type","val |
>>>>> 0080: 75 65 22 3A 22 4D 69 73 73 69 6E 67 20 72 65 71 |
>>>>> ue":"Missing req |
>>>>> 0090: 75 69 72 65 64 20 69 64 65 6E 74 69 66 69 65 72 | uired
>>>>> identifier |
>>>>> 00A0: 20 74 79 70 65 20 7A 45 68 51 6D 5A 65 6F 52 4E | type
>>>>> zEhQmZeoRN |
>>>>> 00B0: 39 22 7D 2C 7B 22 6F 62 6A 65 63 74 22 3A 22 49 |
>>>>> 9"},{"object":"I |
>>>>> 00C0: 64 65 6E 74 69 66 69 65 72 2E 74 79 70 65 22 2C |
>>>>> dentifier.type", |
>>>>> 00D0: 22 76 61 6C 75 65 22 3A 22 49 6E 76 61 6C 69 64 |
>>>>> "value":"Invalid |
>>>>> 00E0: 20 74 79 70 65 20 6E 75 6C 6C 22 7D 2C 7B 22 6F | type
>>>>> null"},{"o |
>>>>> 00F0: 62 6A 65 63 74 22 3A 22 41 74 74 72 69 62 75 74 |
>>>>> bject":"Attribut |
>>>>> 0100: 65 2E 74 79 70 65 22 2C 22 76 61 6C 75 65 22 3A |
>>>>> e.type","value": |
>>>>> 0110: 22 4D 69 73 73 69 6E 67 20 72 65 71 75 69 72 65 | "Missing
>>>>> require |
>>>>> 0120: 64 20 61 74 74 72 69 62 75 74 65 20 74 79 70 65 | d
>>>>> attribute type |
>>>>> 0130: 20 54 37 70 77 70 4D 64 61 56 56 61 22 7D 2C 7B |
>>>>> T7pwpMdaVVa"},{ |
>>>>> 0140: 22 6F 62 6A 65 63 74 22 3A 22 41 74 74 72 69 62 |
>>>>> "object":"Attrib |
>>>>> 0150: 75 74 65 2E 74 79 70 65 22 2C 22 76 61 6C 75 65 |
>>>>> ute.type","value |
>>>>> 0160: 22 3A 22 4D 69 73 73 69 6E 67 20 72 65 71 75 69 | ":"Missing
>>>>> requi |
>>>>> 0170: 72 65 64 20 61 74 74 72 69 62 75 74 65 20 74 79 | red
>>>>> attribute ty |
>>>>> 0180: 70 65 20 50 47 74 57 56 61 4D 33 75 58 7A 22 7D | pe
>>>>> PGtWVaM3uXz"} |
>>>>> 0190: 2C 7B 22 6F 62 6A 65 63 74 22 3A 22 41 74 74 72 |
>>>>> ,{"object":"Attr |
>>>>> 01A0: 69 62 75 74 65 2E 74 79 70 65 22 2C 22 76 61 6C |
>>>>> ibute.type","val |
>>>>> 01B0: 75 65 22 3A 22 4D 69 73 73 69 6E 67 20 72 65 71 |
>>>>> ue":"Missing req |
>>>>> 01C0: 75 69 72 65 64 20 61 74 74 72 69 62 75 74 65 20 | uired
>>>>> attribute |
>>>>> 01D0: 74 79 70 65 20 75 52 47 65 4A 38 34 4C 4B 62 35 | type
>>>>> uRGeJ84LKb5 |
>>>>> 01E0: 22 7D 2C 7B 22 6F 62 6A 65 63 74 22 3A 22 41 74 |
>>>>> "},{"object":"At |
>>>>> 01F0: 74 72 69 62 75 74 65 2E 74 79 70 65 22 2C 22 76 |
>>>>> tribute.type","v |
>>>>> 0200: 61 6C 75 65 22 3A 22 49 6E 76 61 6C 69 64 20 74 |
>>>>> alue":"Invalid t |
>>>>> 0210: 79 70 65 20 6E 75 6C 6C 22 7D 2C 7B 22 6F 62 6A | ype
>>>>> null"},{"obj |
>>>>> 0220: 65 63 74 22 3A 22 41 74 74 72 69 62 75 74 65 2E |
>>>>> ect":"Attribute. |
>>>>> 0230: 74 79 70 65 22 2C 22 76 61 6C 75 65 22 3A 22 49 |
>>>>> type","value":"I |
>>>>> 0240: 6E 76 61 6C 69 64 20 74 79 70 65 20 6E 75 6C 6C | nvalid
>>>>> type null |
>>>>> 0250: 22 7D 2C 7B 22 6F 62 6A 65 63 74 22 3A 22 41 74 |
>>>>> "},{"object":"At |
>>>>> 0260: 74 72 69 62 75 74 65 2E 74 79 70 65 22 2C 22 76 |
>>>>> tribute.type","v |
>>>>> 0270: 61 6C 75 65 22 3A 22 49 6E 76 61 6C 69 64 20 74 |
>>>>> alue":"Invalid t |
>>>>> 0280: 79 70 65 20 6E 75 6C 6C 22 7D 5D 7D | ype
>>>>> null"}]} |
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Pierre
>>>>>
>>>>>
>>>>> On 23 Feb 2014, at 5:09 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> What version of 2.14 are you running? there was several fixes related
>>>>> to 2.14 a few weeks after the release. After you create a person, you can
>>>>> access its data through /api/person/UID, and the output from that
>>>>> endpoint.. you should be able to send back as a PUT request
>>>>>
>>>>> --
>>>>> Morten
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>> --
>>
>> *Pascal Brandt Senio*
>>
>> *r Software Developer, Jembi Health Systems | SOUTH AFRICA Mobile: +27 84
>> 827 9342 <%2B27%2084%20827%209342> | Office: +27 21 701 0939
>> <%2B27%2021%20701%200939> | Skype: psbrandt E-mail: pascal@xxxxxxxxx
>> <pascal@xxxxxxxxx>*
>>
>
>
Attachment:
person.json
Description: application/json
References