AnsweredAssumed Answered

change password using dotcmis

Question asked by shivtechno on Dec 5, 2016
Latest reply on Dec 5, 2016 by mitpatoliya

Hi ,

 

I facing trouble while posting data to change password some one know whate parameter required to post for change password through DotCmis.

I had worked on this kindly see the below code for refrance..

   HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create("http://ServerIp:8080/alfresco/service/api/people/changepassword/" + UserName);

 


                // use default credentials
                webReq.UseDefaultCredentials = true; webReq.Headers.Add("Authorization", authorization);

 

                // sets the method as a get
                webReq.Method = "POST";
                string RepairPassword = Password.Replace(@"/", "");
               // string NewPassword = RepairPassword.Replace(@"=", "");
                string postData = "{ userName:" + Convert.ToString(UserName) + ", password: '" + Convert.ToString(RepairPassword) + "', firstName:" + Convert.ToString(UserName) + ", lastName:'NA', email:" + UserName + ", disableAccount: false, quote: -1, groups: [] }";
                byte[] byteArray = Encoding.UTF8.GetBytes(postData);
                // Set the ContentType property of the WebRequest.
                webReq.ContentType = "application/json";
                // Set the ContentLength property of the WebRequest.
                webReq.ContentLength = byteArray.Length;
                // Get the request stream.
                Stream dataStream = webReq.GetRequestStream();
                // Write the data to the request stream.
                dataStream.Write(byteArray, 0, byteArray.Length);
                // Close the Stream object.
                dataStream.Close();

 

Thanks & Regards,

Shivkumar Swami

Outcomes