Skip to main content

v23 -> v24

HTTP Basic Authentication Removed​

HTTP Basic authentication is no longer supported. OAuth2 client credentials are now the only supported authentication method.

The username and password parameters and attributes have been removed from Configuration, along with the get_basic_auth_token() method. Passing them to Configuration now raises an error:

TypeError: Configuration.__init__() got an unexpected keyword argument 'username'

Replace your username and password with an OAuth2 client ID and secret. See Credentials Management for how to obtain them.

configuration = bandwidth.Configuration(
client_id=os.environ["BW_CLIENT_ID"],
client_secret=os.environ["BW_CLIENT_SECRET"]
)

Postback Data Type Change​

postback_data has been changed from Union[bytes, str] to str, and is no longer described as Base64. It is now an opaque string with a maximum length of 2048 characters. This affects the following models:

  • RbmActionBase
  • RbmActionDial
  • RbmActionOpenUrl
  • RbmActionViewLocation
  • MultiChannelActionCalendarEvent
  • RbmSuggestionResponse

Passing bytes now raises a pydantic ValidationError when the model is constructed. In v23, bytes values were accepted by the model but could not be serialized when the request was sent.

action = RbmActionDial(
type=RbmActionTypeEnum.DIAL_PHONE,
text="Call Us",
postback_data="track-order",
phone_number="+15554443333"
)