Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ bandwidth/models/rbm_message_content_rich_card.py
bandwidth/models/rbm_message_content_text.py
bandwidth/models/rbm_message_media.py
bandwidth/models/rbm_open_url_enum.py
bandwidth/models/rbm_session.py
bandwidth/models/rbm_standalone_card.py
bandwidth/models/rbm_suggestion_response.py
bandwidth/models/rbm_web_view_enum.py
Expand Down Expand Up @@ -377,6 +378,7 @@ docs/RbmMessageContentRichCard.md
docs/RbmMessageContentText.md
docs/RbmMessageMedia.md
docs/RbmOpenUrlEnum.md
docs/RbmSession.md
docs/RbmStandaloneCard.md
docs/RbmSuggestionResponse.md
docs/RbmWebViewEnum.md
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ Class | Method | HTTP request | Description
- [RbmMessageContentText](docs/RbmMessageContentText.md)
- [RbmMessageMedia](docs/RbmMessageMedia.md)
- [RbmOpenUrlEnum](docs/RbmOpenUrlEnum.md)
- [RbmSession](docs/RbmSession.md)
- [RbmStandaloneCard](docs/RbmStandaloneCard.md)
- [RbmSuggestionResponse](docs/RbmSuggestionResponse.md)
- [RbmWebViewEnum](docs/RbmWebViewEnum.md)
Expand Down
197 changes: 189 additions & 8 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2620,14 +2620,13 @@ components:
type: string
description: Displayed text for user to click
maxLength: 25
example: Hello world
example: Track my order
rbmActionPostbackData:
title: Post Back Data
type: string
format: byte
description: Base64 payload the customer receives when the reply is clicked.
description: Payload the customer receives when the reply is clicked.
maxLength: 2048
example: SGVsbG8gd29ybGQ=
example: track-order-43654
rbmActionBase:
type: object
properties:
Expand Down Expand Up @@ -2916,8 +2915,8 @@ components:
properties:
text:
type: string
description: The text associated with the suggestion response.
example: Yes, I would like to proceed
description: The text of the suggestion the user tapped.
example: Track my order
postbackData:
$ref: '#/components/schemas/rbmActionPostbackData'
pairedMessageId:
Expand All @@ -2938,6 +2937,70 @@ components:
format: double
description: The longitude of the client's location.
example: '-122.4194'
rbmSession:
type: object
description: >-
RCS interactive session information for the message.

An interactive session is a 24-hour window covering all Rich and Rich
Media messages exchanged between an

RCS agent and a specific end user mobile number. It is triggered when at
least 4 messages are exchanged within

24 hours, at least 2 of them mobile-originated and at least 1
mobile-terminated.

Only present on `message-delivered`, `message-received` and
`session-started` callbacks for RBM messages of

US agents with the Conversational billing category. Omitted for all
other messages.
properties:
canInitiate:
type: boolean
description: >-
Whether the message can start an interactive session.

`false` if the message is already part of an active session, or if
the agent is not eligible for

interactive session billing.
example: false
id:
type: string
nullable: true
description: >-
The unique identifier of the interactive session the message is part
of. This is not a message ID.

Omitted if the message is not part of a session.
example: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d
type:
type: string
nullable: true
description: |-
The type of the interactive session.
Only present on `session-started` callbacks.
example: INTERACTIVE_SESSION
startTime:
type: string
nullable: true
format: date-time
description: >-
The time the 24-hour session window opened. Only present on
`session-started` callbacks.
example: '2026-08-06T09:59:55Z'
endTime:
type: string
nullable: true
format: date-time
description: >-
The time the 24-hour session window closes. Only present on
`session-started` callbacks.
example: '2026-08-07T09:59:55Z'
required:
- canInitiate
callback:
description: >-
Callbacks are divided into two types based on direction of the related
Expand All @@ -2960,6 +3023,7 @@ components:
message-delivered: '#/components/schemas/statusCallback'
message-failed: '#/components/schemas/statusCallback'
message-read: '#/components/schemas/statusCallback'
session-started: '#/components/schemas/statusCallback'
message-received: '#/components/schemas/inboundCallback'
requested-location-response: '#/components/schemas/inboundCallback'
suggestion-response: '#/components/schemas/inboundCallback'
Expand Down Expand Up @@ -3060,12 +3124,17 @@ components:

- `message-read` indicates that the RBM message was read by the
recipient.

- `session-started` indicates that a previously exchanged RBM message is
now part of an RCS interactive session and is no longer billed
individually.
enum:
- message-sending
- message-sent
- message-delivered
- message-failed
- message-read
- session-started
example: message-delivered
inboundCallbackTypeEnum:
type: string
Expand Down Expand Up @@ -3143,6 +3212,8 @@ components:
$ref: '#/components/schemas/priorityEnum'
channel:
$ref: '#/components/schemas/multiChannelMessageChannelEnum'
session:
$ref: '#/components/schemas/rbmSession'
required:
- id
- owner
Expand Down Expand Up @@ -8878,6 +8949,31 @@ components:
media:
- >-
https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png
rbmMessageReceivedSessionCallbackExample:
summary: >-
An example of a rbm message-received callback body for a message that is
part of an RCS interactive session.
value:
time: '2026-08-06T10:00:05.502180Z'
type: message-received
to: BandwidthRBM
description: Incoming message received
message:
id: 1786010405502l2ntaoajuqjhqnxu
owner: BandwidthRBM
applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
time: '2026-08-06T10:00:05.302180Z'
segmentCount: 1
direction: in
to:
- BandwidthRBM
from: '+12345678902'
channel: RBM
content:
text: Yes, please book it for tomorrow.
session:
canInitiate: false
id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d
messageSendingCallbackExample:
summary: An example of a message-sending callback body.
value:
Expand Down Expand Up @@ -8977,6 +9073,79 @@ components:
owner: '+12345678902'
direction: out
segmentCount: 1
rbmMessageDeliveredSessionCallbackExample:
summary: >-
An example of a rbm message-delivered callback body for a message that
is part of an RCS interactive session.
value:
type: message-delivered
time: '2026-08-06T10:01:11.160744Z'
description: Message delivered to handset.
to: '+12345678902'
message:
id: 1786010470868ty55yp2b2kw2fuq
time: '2026-08-06T10:01:10.868292Z'
to:
- '+12345678902'
from: BandwidthRBM
text: ''
applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
owner: BandwidthRBM
direction: out
segmentCount: 1
channel: RBM
session:
canInitiate: false
id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d
rbmMessageDeliveredCanInitiateSessionCallbackExample:
summary: >-
An example of a rbm message-delivered callback body for a message that
is not yet part of an RCS interactive session.
value:
type: message-delivered
time: '2026-08-06T09:59:56.160744Z'
description: Message delivered to handset.
to: '+12345678902'
message:
id: 1786010395000kw2fuqty55yp2b2
time: '2026-08-06T09:59:55.000000Z'
to:
- '+12345678902'
from: BandwidthRBM
text: ''
applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
owner: BandwidthRBM
direction: out
segmentCount: 1
channel: RBM
session:
canInitiate: true
sessionStartedCallbackExample:
summary: An example of a session-started callback body.
value:
type: session-started
time: '2026-08-06T10:00:00.123000Z'
description: Message is now part of an RCS interactive session.
to: '+12345678902'
message:
id: 1786010395000kw2fuqty55yp2b2
owner: BandwidthRBM
applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
time: '2026-08-06T10:00:00.120000Z'
segmentCount: 1
direction: out
to:
- '+12345678902'
from: BandwidthRBM
text: ''
tag: ''
channel: RBM
session:
canInitiate: false
id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d
type: INTERACTIVE_SESSION
startTime: '2026-08-06T09:59:55Z'
endTime: '2026-08-07T09:59:55Z'
messageFailedCallbackExample:
summary: An example of a message-failed callback body.
value:
Expand Down Expand Up @@ -9980,6 +10149,9 @@ components:
$ref: '#/components/examples/smsMessageReceivedCallbackExample'
mmsMessageReceivedCallback:
$ref: '#/components/examples/mmsMessageReceivedCallbackExample'
rbmMessageReceivedSessionCallback:
$ref: >-
#/components/examples/rbmMessageReceivedSessionCallbackExample
responses:
'200':
description: OK
Expand All @@ -9995,8 +10167,9 @@ components:
information regarding a message sent (MT)

from your message-enabled Bandwidth telephone number.
<p>The payload type will be one of <code>message-sending</code>, <code>message-sent</code>, <code>message-delivered</code>, <code>message-failed</code> or <code>message-read</code>.
<p>Note that <code>message-read</code> callbacks are pertinent only for RBM messages sent from the <code>/messages/multiChannel</code> endpoint.
<p>The payload type will be one of <code>message-sending</code>, <code>message-sent</code>, <code>message-delivered</code>, <code>message-failed</code>, <code>message-read</code> or <code>session-started</code>.
<p>Note that <code>message-read</code> and <code>session-started</code> callbacks are pertinent only for RBM messages sent from the <code>/messages/multiChannel</code> endpoint.
<p>Note that <code>session-started</code> callbacks are pertinent only for RBM messages of agents with the Conversational billing category.
</p><p>Please visit <a
href='/docs/messaging/webhooks/'>Webhooks</a></p>
content:
Expand All @@ -10015,8 +10188,16 @@ components:
groupMmsMessageDeliveredCallback:
$ref: >-
#/components/examples/groupMmsMessageDeliveredCallbackExample
rbmMessageDeliveredSessionCallback:
$ref: >-
#/components/examples/rbmMessageDeliveredSessionCallbackExample
rbmMessageDeliveredCanInitiateSessionCallback:
$ref: >-
#/components/examples/rbmMessageDeliveredCanInitiateSessionCallbackExample
messageFailedCallback:
$ref: '#/components/examples/messageFailedCallbackExample'
sessionStartedCallback:
$ref: '#/components/examples/sessionStartedCallbackExample'
responses:
'200':
description: OK
Expand Down
2 changes: 2 additions & 0 deletions bandwidth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"RbmMessageContentText",
"RbmMessageMedia",
"RbmOpenUrlEnum",
"RbmSession",
"RbmStandaloneCard",
"RbmSuggestionResponse",
"RbmWebViewEnum",
Expand Down Expand Up @@ -415,6 +416,7 @@
from bandwidth.models.rbm_message_content_text import RbmMessageContentText as RbmMessageContentText
from bandwidth.models.rbm_message_media import RbmMessageMedia as RbmMessageMedia
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum as RbmOpenUrlEnum
from bandwidth.models.rbm_session import RbmSession as RbmSession
from bandwidth.models.rbm_standalone_card import RbmStandaloneCard as RbmStandaloneCard
from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse as RbmSuggestionResponse
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum as RbmWebViewEnum
Expand Down
1 change: 1 addition & 0 deletions bandwidth/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
from bandwidth.models.rbm_message_content_text import RbmMessageContentText
from bandwidth.models.rbm_message_media import RbmMessageMedia
from bandwidth.models.rbm_open_url_enum import RbmOpenUrlEnum
from bandwidth.models.rbm_session import RbmSession
from bandwidth.models.rbm_standalone_card import RbmStandaloneCard
from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse
from bandwidth.models.rbm_web_view_enum import RbmWebViewEnum
Expand Down
1 change: 1 addition & 0 deletions bandwidth/models/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Callback(BaseModel):
'message-sending': 'StatusCallback',
'message-sent': 'StatusCallback',
'requested-location-response': 'InboundCallback',
'session-started': 'StatusCallback',
'suggestion-response': 'InboundCallback'
}

Expand Down
8 changes: 7 additions & 1 deletion bandwidth/models/inbound_callback_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent
from bandwidth.models.priority_enum import PriorityEnum
from bandwidth.models.rbm_location_response import RbmLocationResponse
from bandwidth.models.rbm_session import RbmSession
from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -47,11 +48,12 @@ class InboundCallbackMessage(BaseModel):
media: Optional[List[StrictStr]] = Field(default=None, description="Optional media, not applicable for sms")
priority: Optional[PriorityEnum] = None
channel: Optional[MultiChannelMessageChannelEnum] = None
session: Optional[RbmSession] = None
content: Optional[MultiChannelMessageContent] = None
suggestion_response: Optional[RbmSuggestionResponse] = Field(default=None, alias="suggestionResponse")
location_response: Optional[RbmLocationResponse] = Field(default=None, alias="locationResponse")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority", "channel", "content", "suggestionResponse", "locationResponse"]
__properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority", "channel", "session", "content", "suggestionResponse", "locationResponse"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -94,6 +96,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of session
if self.session:
_dict['session'] = self.session.to_dict()
# override the default output from pydantic by calling `to_dict()` of content
if self.content:
_dict['content'] = self.content.to_dict()
Expand Down Expand Up @@ -133,6 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"media": obj.get("media"),
"priority": obj.get("priority"),
"channel": obj.get("channel"),
"session": RbmSession.from_dict(obj["session"]) if obj.get("session") is not None else None,
"content": MultiChannelMessageContent.from_dict(obj["content"]) if obj.get("content") is not None else None,
"suggestionResponse": RbmSuggestionResponse.from_dict(obj["suggestionResponse"]) if obj.get("suggestionResponse") is not None else None,
"locationResponse": RbmLocationResponse.from_dict(obj["locationResponse"]) if obj.get("locationResponse") is not None else None
Expand Down
4 changes: 2 additions & 2 deletions bandwidth/models/multi_channel_action_calendar_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum
from typing import Optional, Set
Expand All @@ -32,7 +32,7 @@ class MultiChannelActionCalendarEvent(BaseModel):
""" # noqa: E501
type: RbmActionTypeEnum
text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click")
postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
postback_data: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="Payload the customer receives when the reply is clicked.", alias="postbackData")
title: Annotated[str, Field(strict=True, max_length=100)] = Field(description="The title of the event.")
start_time: datetime = Field(description="The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", alias="startTime")
end_time: datetime = Field(description="The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", alias="endTime")
Expand Down
Loading