AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.
phone-number-validate
--number-validate-request <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
--number-validate-request
(structure)
Specifies a phone number to validate and retrieve information about.
IsoCountryCode -> (string)
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.PhoneNumber -> (string)
The phone number to retrieve information about. The phone number that you provide should include a valid numeric country code. Otherwise, the operation might result in an error.
Shorthand Syntax:
IsoCountryCode=string,PhoneNumber=string
JSON Syntax:
{
"IsoCountryCode": "string",
"PhoneNumber": "string"
}
--cli-input-json
(string)
Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command's default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Retrieves information about a phone number
The following phone-number-validate
retrieves information about a phone number.
aws pinpoint phone-number-validate \
--number-validate-request PhoneNumber="+12065550142" \
--region us-east-1
Output:
{
"NumberValidateResponse": {
"Carrier": "ExampleCorp Mobile",
"City": "Seattle",
"CleansedPhoneNumberE164": "+12065550142",
"CleansedPhoneNumberNational": "2065550142",
"Country": "United States",
"CountryCodeIso2": "US",
"CountryCodeNumeric": "1",
"OriginalPhoneNumber": "+12065550142",
"PhoneType": "MOBILE",
"PhoneTypeCode": 0,
"Timezone": "America/Los_Angeles",
"ZipCode": "98101"
}
}
For more information, see Amazon Pinpoint SMS channel in the Amazon Pinpoint User Guide.
NumberValidateResponse -> (structure)
Provides information about a phone number.
Carrier -> (string)
The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.City -> (string)
The name of the city where the phone number was originally registered.CleansedPhoneNumberE164 -> (string)
The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.CleansedPhoneNumberNational -> (string)
The cleansed phone number, in the format for the location where the phone number was originally registered.Country -> (string)
The name of the country or region where the phone number was originally registered.CountryCodeIso2 -> (string)
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.CountryCodeNumeric -> (string)
The numeric code for the country or region where the phone number was originally registered.County -> (string)
The name of the county where the phone number was originally registered.OriginalCountryCodeIso2 -> (string)
The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.OriginalPhoneNumber -> (string)
The phone number that was sent in the request body.PhoneType -> (string)
The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.PhoneTypeCode -> (integer)
The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).Timezone -> (string)
The time zone for the location where the phone number was originally registered.ZipCode -> (string)
The postal or ZIP code for the location where the phone number was originally registered.