← Back to team overview

dhis2-devs team mailing list archive

Re: Is it possible to change the passwd of the users using the API??

 

You need to send the full payload. Are you on 2.18? you could use PATCH for
this now.. something like

{
  "password": "new-password"
}

curl -X PATCH -d @password.json -u user:pass
http://localhost:8080/api/users/ID/password

(untested, but should work)

--
Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz <josemp10@xxxxxxxxx>
wrote:

>
> Thanks Jason,
>
> sorry, and how should it work? I tried with the following call...
>
> curl.exe -d @user.json "http://localhost:8080/dhis/api/users/oEiOvqVp3A9";
> -H "Content-Type:application/json" -u myuser:mypasswd -v
>
> where the user.json file just contains
>
> {
>   "username": "the_user_name",
>   "password": "the_user_passwd"
> }
>
> But the system gives me an error
>
> Am I missing something?
>
> Thanks
> Jose
>
> On Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering <
> jason.p.pickering@xxxxxxxxx> wrote:
>
>> Hi Jose,
>>
>> Yes, it is possible to send the plain-text password of a user to the
>> system using the API, which will then hash the password for you and
>> persist it in the database.
>>
>> Best regards,
>> Jason
>>
>>
>>
>> On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz <josemp10@xxxxxxxxx>
>> wrote:
>> >
>> > Hi devs,
>> >
>> > I didn't see anything in the documentation in that regard. I could only
>> find
>> > out the user replication as the only way to specify a user passwd using
>> the
>> > API. Am I correct?
>> >
>> > Thanks
>> > Jose
>> >
>> > _______________________________________________
>> > Mailing list: https://launchpad.net/~dhis2-devs
>> > Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> > Unsubscribe : https://launchpad.net/~dhis2-devs
>> > More help   : https://help.launchpad.net/ListHelp
>> >
>>
>>
>>
>> --
>> Jason P. Pickering
>> email: jason.p.pickering@xxxxxxxxx
>> tel:+46764147049
>>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References