I'm looking for a way to validate a phone number using AWS SNS in my asp.net core app but I cannot find any resource on this matter. Can someone explain how to do this using AWS SDK for .NET ?
Asked
Active
Viewed 356 times
0
-
Phone number for an account with Cognito for example? Why SNS in particular? Text? Email? Call? Please add more information. – Ermiya Eskandary Oct 05 '21 at 21:16
1 Answers
0
as @Ermiya Eskandary suggested, more information is needed.
It sounds like you are publishing an sms text message in this example https://docs.aws.amazon.com/sns/latest/dg/example_sns_PublishTextSMS_section.html
It also sounds like you are trying to validate a phone number before using psms_req.SetPhoneNumber(phone_number);
There are several methods for validating a phone number, the most simple is using regex, the second is by using a reverse lookup. AWS offers AWS PinPoint which will allow you to do a reverse lookup.
Alternatively you can use a simple regex, Regex to match all us phone number formats

THE AMAZING
- 1,496
- 2
- 16
- 38