SearchAvailablePhoneNumbers
Searches for available phone numbers that you can claim to your Amazon Connect instance
or traffic distribution group. If the provided TargetArn
is a traffic distribution group, you can call this API in both
AWS Regions associated with the traffic distribution group.
Request Syntax
POST /phone-number/search-available HTTP/1.1
Content-type: application/json
{
"InstanceId": "string
",
"MaxResults": number
,
"NextToken": "string
",
"PhoneNumberCountryCode": "string
",
"PhoneNumberPrefix": "string
",
"PhoneNumberType": "string
",
"TargetArn": "string
"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- InstanceId
-
The identifier of the Amazon Connect instance that phone numbers are claimed to. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. You must enter
InstanceId
orTargetArn
.Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: No
- MaxResults
-
The maximum number of results to return per page.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 10.
Required: No
- NextToken
-
The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100000.
Required: No
- PhoneNumberCountryCode
-
The ISO country code.
Type: String
Valid Values:
AF | AL | DZ | AS | AD | AO | AI | AQ | AG | AR | AM | AW | AU | AT | AZ | BS | BH | BD | BB | BY | BE | BZ | BJ | BM | BT | BO | BA | BW | BR | IO | VG | BN | BG | BF | BI | KH | CM | CA | CV | KY | CF | TD | CL | CN | CX | CC | CO | KM | CK | CR | HR | CU | CW | CY | CZ | CD | DK | DJ | DM | DO | TL | EC | EG | SV | GQ | ER | EE | ET | FK | FO | FJ | FI | FR | PF | GA | GM | GE | DE | GH | GI | GR | GL | GD | GU | GT | GG | GN | GW | GY | HT | HN | HK | HU | IS | IN | ID | IR | IQ | IE | IM | IL | IT | CI | JM | JP | JE | JO | KZ | KE | KI | KW | KG | LA | LV | LB | LS | LR | LY | LI | LT | LU | MO | MK | MG | MW | MY | MV | ML | MT | MH | MR | MU | YT | MX | FM | MD | MC | MN | ME | MS | MA | MZ | MM | NA | NR | NP | NL | AN | NC | NZ | NI | NE | NG | NU | KP | MP | NO | OM | PK | PW | PA | PG | PY | PE | PH | PN | PL | PT | PR | QA | CG | RE | RO | RU | RW | BL | SH | KN | LC | MF | PM | VC | WS | SM | ST | SA | SN | RS | SC | SL | SG | SX | SK | SI | SB | SO | ZA | KR | ES | LK | SD | SR | SJ | SZ | SE | CH | SY | TW | TJ | TZ | TH | TG | TK | TO | TT | TN | TR | TM | TC | TV | VI | UG | UA | AE | GB | US | UY | UZ | VU | VA | VE | VN | WF | EH | YE | ZM | ZW
Required: Yes
- PhoneNumberPrefix
-
The prefix of the phone number. If provided, it must contain
+
as part of the country code.Type: String
Pattern:
\\+?[0-9]{1,11}
Required: No
- PhoneNumberType
-
The type of phone number.
Type: String
Valid Values:
TOLL_FREE | DID | UIFN | SHARED | THIRD_PARTY_TF | THIRD_PARTY_DID | SHORT_CODE
Required: Yes
- TargetArn
-
The Amazon Resource Name (ARN) for Amazon Connect instances or traffic distribution groups that phone number inbound traffic is routed through. You must enter
InstanceId
orTargetArn
.Type: String
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"AvailableNumbersList": [
{
"PhoneNumber": "string",
"PhoneNumberCountryCode": "string",
"PhoneNumberType": "string"
}
],
"NextToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- AvailableNumbersList
-
A list of available phone numbers that you can claim to your Amazon Connect instance or traffic distribution group.
Type: Array of AvailableNumberSummary objects
- NextToken
-
If there are additional results, this is the token for the next set of results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100000.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
HTTP Status Code: 400
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: