← Back to team overview

dhis2-devs team mailing list archive

Re: User password reset through API

 

Hello,

What kind of payload are you trying to send to the Server remember that the
password and the username are under userCredentials and not directly under
the user.

so the payload should be like :

{

"userCredenttials":{

"id": "userCredentialsID_of_the_user_(Separate from the userID)",

"password":"the_new_password",

"username":"userName"

}

}

Hope this helps, if anything is unclear please feel free to ask.

On Sat, Mar 31, 2018 at 8:21 AM, Hannan Khan <hannank@xxxxxxxxx> wrote:

> Hello Experts
>
> Hope you are all enjoying Easter.
>
> I am trying to reset/update password through API. Is it possible to send
> PUT request with jason payload with only ID, username and password? I use
>
> curl -X PUT -u user:pass -d @u.json -H "Content-Type: application/json"
> https://server/api/26/users/ID
>
>  I am getting following error:
>
> {"httpStatus":"Conflict","httpStatusCode":409,"status":"
> ERROR","message":"org.hisp.dhis.user.User does not exist: ID"}
>
> Please advice.
>
> Regards
> --
> Muhammad Abdul Hannan Khan
> Team Leader
> Support to the National HMIS
> MIS, Director General of Health Service
> Ministry of Health and Family Welfare
>
> T +880-2- 58816459 <+880%202-58816459>, 58816412 ext 118
> F +88 02 58813 875
> M+88 01819 239 241
> M+88 01534 312 066
> E hannank@xxxxxxxxx
> S hannan.khan.dhaka
> B hannan-tech.blogspot.com
> L https://bd.linkedin.com/in/hannankhan
>
>
>
>
> _______________________________________________
> 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
>
>


-- 
Melaeke Serawit
BSc.Computer Engineering
Addis Ababa University
+251913090792

Follow ups

References