I am new in magento api developement for mobile app. I have to write API code for login. This application login has no password and login by mobile phone otp verification. During my coding, I can access customer id by email.
$customer = $this->customerFactory->create();
$customer->loadByEmail($email);
$customerId = $customer->getId();
But I need to access this customer id by phone number,instead of this. What will be the code for 'loadbyphone'?
We can do it following way. But make sure Phone number is unique.