I am using following code in soap api for forgot password for magento and how can send mail for change password link perticular user throw api using magento functionality mail using if any simple mathed for related rest api guide me
error_reporting(0);
$client = new SoapClient('http://127.0.0.1/mycart/api/soap/?wsdl');
$session = $client->login('admin', '123456789');
$return_array = array ();
$result = $client->call($session, 'customer.list');
$email=addslashes($_POST['email']);
//$email=addslashes("test@mail.com");
if(!empty($email)){
foreach ($result as $key=>$value){
//echo $value[email];
if ($value[email]==$email)
{
$return_array['message']="You will receive an email with a link to reset your password ";
$return_array['status']= "1";
echo json_encode($return_array);
exit;
}elseif ($value[email]!=$email) {
$return_array['message']="You are not registered with us. Please sign up to create an account";
$return_array['status']= "2";
echo json_encode($return_array);
exit;
}
}
}
else {
$return_array['message']="You are not registered with us. Please sign up to create an account ";
$return_array['status']= "0";
echo json_encode($return_array);
exit;
}
exit;
I guess you are using admin credentials for client login also you are using magento api V1 whether Magento v1 or v2 api needs api user. Please follow the guidance https://www.yireo.com/tutorials/magebridge/administration/596-step-by-step-create-a-magento-api-user