PinpointSMSVoiceV2 / Client / update_phone_number
update_phone_number#
- PinpointSMSVoiceV2.Client.update_phone_number(**kwargs)#
Updates the configuration of an existing origination phone number. You can update the opt-out list, enable or disable two-way messaging, change the TwoWayChannelArn, enable or disable self-managed opt-outs, and enable or disable deletion protection.
If the origination phone number is associated with a pool, an error is returned.
See also: AWS API Documentation
Request Syntax
response = client.update_phone_number( PhoneNumberId='string', TwoWayEnabled=True|False, TwoWayChannelArn='string', TwoWayChannelRole='string', SelfManagedOptOutsEnabled=True|False, OptOutListName='string', DeletionProtectionEnabled=True|False )
- Parameters:
PhoneNumberId (string) –
[REQUIRED]
The unique identifier of the phone number. Valid values for this field can be either the PhoneNumberId or PhoneNumberArn.
TwoWayEnabled (boolean) – By default this is set to false. When set to true you can receive incoming text messages from your end recipients.
TwoWayChannelArn (string) – The Amazon Resource Name (ARN) of the two way channel.
TwoWayChannelRole (string) – An optional IAM Role Arn for a service to assume, to be able to post inbound SMS messages.
SelfManagedOptOutsEnabled (boolean) – By default this is set to false. When an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, Amazon Pinpoint automatically replies with a customizable message and adds the end recipient to the OptOutList. When set to true you’re responsible for responding to HELP and STOP requests. You’re also responsible for tracking and honoring opt-out requests.
OptOutListName (string) – The OptOutList to add the phone number to. Valid values for this field can be either the OutOutListName or OutOutListArn.
DeletionProtectionEnabled (boolean) – By default this is set to false. When set to true the phone number can’t be deleted.
- Return type:
dict
- Returns:
Response Syntax
{ 'PhoneNumberArn': 'string', 'PhoneNumberId': 'string', 'PhoneNumber': 'string', 'Status': 'PENDING'|'ACTIVE'|'ASSOCIATING'|'DISASSOCIATING'|'DELETED', 'IsoCountryCode': 'string', 'MessageType': 'TRANSACTIONAL'|'PROMOTIONAL', 'NumberCapabilities': [ 'SMS'|'VOICE'|'MMS', ], 'NumberType': 'SHORT_CODE'|'LONG_CODE'|'TOLL_FREE'|'TEN_DLC'|'SIMULATOR', 'MonthlyLeasingPrice': 'string', 'TwoWayEnabled': True|False, 'TwoWayChannelArn': 'string', 'TwoWayChannelRole': 'string', 'SelfManagedOptOutsEnabled': True|False, 'OptOutListName': 'string', 'DeletionProtectionEnabled': True|False, 'RegistrationId': 'string', 'CreatedTimestamp': datetime(2015, 1, 1) }
Response Structure
(dict) –
PhoneNumberArn (string) –
The Amazon Resource Name (ARN) of the updated phone number.
PhoneNumberId (string) –
The unique identifier of the phone number.
PhoneNumber (string) –
The phone number that was updated.
Status (string) –
The current status of the request.
IsoCountryCode (string) –
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
MessageType (string) –
The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren’t critical or time-sensitive.
NumberCapabilities (list) –
Specifies if the number could be used for text messages, voice or both.
(string) –
NumberType (string) –
The type of number that was requested.
MonthlyLeasingPrice (string) –
The monthly leasing price of the phone number, in US dollars.
TwoWayEnabled (boolean) –
By default this is set to false. When set to true you can receive incoming text messages from your end recipients.
TwoWayChannelArn (string) –
The Amazon Resource Name (ARN) of the two way channel.
TwoWayChannelRole (string) –
An optional IAM Role Arn for a service to assume, to be able to post inbound SMS messages.
SelfManagedOptOutsEnabled (boolean) –
This is true if self managed opt-out are enabled.
OptOutListName (string) –
The name of the OptOutList associated with the phone number.
DeletionProtectionEnabled (boolean) –
When set to true the phone number can’t be deleted.
RegistrationId (string) –
The unique identifier for the registration.
CreatedTimestamp (datetime) –
The time when the phone number was created, in UNIX epoch time format.
Exceptions
PinpointSMSVoiceV2.Client.exceptions.ThrottlingException
PinpointSMSVoiceV2.Client.exceptions.AccessDeniedException
PinpointSMSVoiceV2.Client.exceptions.ResourceNotFoundException
PinpointSMSVoiceV2.Client.exceptions.ValidationException
PinpointSMSVoiceV2.Client.exceptions.ConflictException
PinpointSMSVoiceV2.Client.exceptions.InternalServerException