request_phone_number
¶
request_phone_number(
iso_country_code: IsoCountryCode,
message_type: MessageType,
number_capabilities: NumberCapabilityList,
number_type: RequestableNumberType,
*,
config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
opt_out_list_name: Optional[OptOutListNameOrArn] = None,
pool_id: Optional[PoolIdOrArn] = None,
registration_id: Optional[RegistrationIdOrArn] = None,
number_preference: Optional[NumberPreferenceList] = None,
international_sending_enabled: Optional[bool] = None,
deletion_protection_enabled: Optional[bool] = None,
tags: Optional[TagList] = None,
client_token: Optional[ClientToken] = None,
) -> RequestPhoneNumberResult
Request an origination phone number for use in your account. For more information on phone number request see Request a phone number in the End User Messaging SMS User Guide.
Parameters:
-
iso_country_code(IsoCountryCode) –The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
-
message_type(MessageType) –The type of message. Valid values are
TRANSACTIONALfor messages that are critical or time-sensitive andPROMOTIONALfor messages that aren't critical or time-sensitive. -
number_capabilities(NumberCapabilityList) –Indicates if the phone number will be used for text messages, voice messages, or both.
-
number_type(RequestableNumberType) –The type of phone number to request.
When you request a
SIMULATORphone number, you must set MessageType asTRANSACTIONAL. -
opt_out_list_name(Optional[OptOutListNameOrArn], default:None) –The name of the OptOutList to associate with the phone number. You can use the OptOutListName or OptOutListArn.
If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).
-
pool_id(Optional[PoolIdOrArn], default:None) –The pool to associated with the phone number. You can use the PoolId or PoolArn.
If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).
-
registration_id(Optional[RegistrationIdOrArn], default:None) –Use this field to attach your phone number for an external registration process.
-
number_preference(Optional[NumberPreferenceList], default:None) –An optional selection preference used to request a specific phone number, such as a number that starts with, ends with, or contains a particular digit pattern. You can specify at most one preference. Number preferences apply only to
TEN_DLCrequests in theUS. -
international_sending_enabled(Optional[bool], default:None) –By default this is set to false. When set to true the international sending of phone number is Enabled.
-
deletion_protection_enabled(Optional[bool], default:None) –By default this is set to false. When set to true the phone number can't be deleted.
-
tags(Optional[TagList], default:None) –An array of tags (key and value pairs) to associate with the requested phone number.
-
client_token(Optional[ClientToken], default:None) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.
Raises:
-
AccessDeniedException–The request was denied because you don't have sufficient permissions to access the resource.
-
ConflictException–Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.
-
InternalServerException–The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.
-
ResourceNotFoundException–A requested resource couldn't be found.
-
ServiceQuotaExceededException–The request would cause a service quota to be exceeded.
-
ThrottlingException–An error that occurred because too many requests were sent during a certain amount of time.
-
ValidationException–A validation exception for a field.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/pinpoint_sms_voice_v2.py
5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 | |