Magento – Customer Forgot Password Rest Api In Magento 2

apicustomermagento2PHP

I am using magento 2 rest api,
when I try to run forgot password api for customer, it is showing an error message.

{"message":"Invalid value of \"%value\" provided for the %fieldName field.","parameters":{"value":"forgot_password","fieldName":"email type"}

I am using below api to send forgot password to user:
{base-url}/rest/V1/customers/password

I have created email template with name forgot_password

I am sending three parameters:
email,template and website

I would be great if anyone can help.

Best Answer

This is working for me:

{
   "email": "email@email.com",
   "template": "email_reset",
   "websiteId": 1
}

template - "email_reset" is not real template which you can create in admin. It is constant which I found in AccountManagenet.php.

Reference

Related Topic