1

I am using services module to consume users account details.

Enabled user in admin->services->resources.

URL: https://drupal.com/service/user/23

method : post

request body:
{ "current_pass":"xyz" "email":"[email protected]" }

I have updated these two values are successfully, but how can I change new password and confirm password values.

How to take these values in request body and I have tried like this(new_pass) but failed to update.

Please help me.

1 Answer 1

3

https://drupal.com/servics/user/9

where 9 is User ID

Method : PUT

Pass 'X-CSRF-Token' paramerter with user token value in header.

Example Call :

{"uid":"9","current_pass":"guessusername1","pass":"guessusername1xxx","pass1":"guessusername1xxx"}

13
  • it shows ["Access denied for user anonymous"] error
    – RaMeSh
    Sep 24, 2015 at 10:03
  • for change your password you need already been logged in. You need to get X-CSRF-Token and then you need to call this change password.
    – vgoradiya
    Sep 24, 2015 at 10:07
  • i have already logged in,and taken X-CSRF token and entered in header page and entered current_pass and pass,pass1 and click on PUT ,same error got.{ACCESS DENIED}
    – RaMeSh
    Sep 24, 2015 at 10:10
  • you need to post not put
    – vgoradiya
    Sep 24, 2015 at 10:11
  • if click POST 404 error ,could not find controller
    – RaMeSh
    Sep 24, 2015 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.