diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7f2bb48b..529223f2 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -158,6 +158,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 @@ -381,6 +382,7 @@ lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb lib/bandwidth-sdk/models/rbm_message_content_text.rb lib/bandwidth-sdk/models/rbm_message_media.rb lib/bandwidth-sdk/models/rbm_open_url_enum.rb +lib/bandwidth-sdk/models/rbm_session.rb lib/bandwidth-sdk/models/rbm_standalone_card.rb lib/bandwidth-sdk/models/rbm_suggestion_response.rb lib/bandwidth-sdk/models/rbm_web_view_enum.rb diff --git a/README.md b/README.md index 60bf8060..f86216e1 100644 --- a/README.md +++ b/README.md @@ -322,6 +322,7 @@ Class | Method | HTTP request | Description - [Bandwidth::RbmMessageContentText](docs/RbmMessageContentText.md) - [Bandwidth::RbmMessageMedia](docs/RbmMessageMedia.md) - [Bandwidth::RbmOpenUrlEnum](docs/RbmOpenUrlEnum.md) + - [Bandwidth::RbmSession](docs/RbmSession.md) - [Bandwidth::RbmStandaloneCard](docs/RbmStandaloneCard.md) - [Bandwidth::RbmSuggestionResponse](docs/RbmSuggestionResponse.md) - [Bandwidth::RbmWebViewEnum](docs/RbmWebViewEnum.md) diff --git a/bandwidth.yml b/bandwidth.yml index 350b6217..a33be21b 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -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: @@ -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: @@ -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 @@ -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' @@ -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 @@ -3143,6 +3212,8 @@ components: $ref: '#/components/schemas/priorityEnum' channel: $ref: '#/components/schemas/multiChannelMessageChannelEnum' + session: + $ref: '#/components/schemas/rbmSession' required: - id - owner @@ -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: @@ -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: @@ -9980,6 +10149,9 @@ components: $ref: '#/components/examples/smsMessageReceivedCallbackExample' mmsMessageReceivedCallback: $ref: '#/components/examples/mmsMessageReceivedCallbackExample' + rbmMessageReceivedSessionCallback: + $ref: >- + #/components/examples/rbmMessageReceivedSessionCallbackExample responses: '200': description: OK @@ -9995,8 +10167,9 @@ components: information regarding a message sent (MT) from your message-enabled Bandwidth telephone number. -
The payload type will be one of message-sending, message-sent, message-delivered, message-failed or message-read.
-
Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.
+
The payload type will be one of message-sending, message-sent, message-delivered, message-failed, message-read or session-started.
+
Note that message-read and session-started callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.
+
Note that session-started callbacks are pertinent only for RBM messages of agents with the Conversational billing category.
Please visit Webhooks
content: @@ -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 diff --git a/docs/Callback.md b/docs/Callback.md index 80aaca3e..e5756655 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -51,6 +51,7 @@ Bandwidth::Callback.openapi_discriminator_mapping # :'message-sending' => :'StatusCallback', # :'message-sent' => :'StatusCallback', # :'requested-location-response' => :'InboundCallback', +# :'session-started' => :'StatusCallback', # :'suggestion-response' => :'InboundCallback' # } ``` diff --git a/docs/InboundCallbackMessage.md b/docs/InboundCallbackMessage.md index 2ef8d8d9..cd7e67a7 100644 --- a/docs/InboundCallbackMessage.md +++ b/docs/InboundCallbackMessage.md @@ -17,6 +17,7 @@ | **media** | **Array<String>** | Optional media, not applicable for sms | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] | +| **session** | [**RbmSession**](RbmSession.md) | | [optional] | | **content** | [**MultiChannelMessageContent**](MultiChannelMessageContent.md) | | [optional] | | **suggestion_response** | [**RbmSuggestionResponse**](RbmSuggestionResponse.md) | | [optional] | | **location_response** | [**RbmLocationResponse**](RbmLocationResponse.md) | | [optional] | @@ -40,6 +41,7 @@ instance = Bandwidth::InboundCallbackMessage.new( media: [https://dev.bandwidth.com/images/bandwidth-logo.png, https://dev.bandwidth.com/images/github_logo.png], priority: null, channel: null, + session: null, content: null, suggestion_response: null, location_response: null diff --git a/docs/MultiChannelAction.md b/docs/MultiChannelAction.md index 2dd71011..a0509c0e 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **phone_number** | **String** | The phone number to dial. Must be E164 format. | | | **latitude** | **Float** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | | | **longitude** | **Float** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | | @@ -26,8 +26,8 @@ require 'bandwidth-sdk' instance = Bandwidth::MultiChannelAction.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, phone_number: +15552223333, latitude: 37.7749, longitude: -122.4194, diff --git a/docs/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md index d493b054..509d4197 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **title** | **String** | The title of the event. | | | **start_time** | **Time** | 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. | | | **end_time** | **Time** | 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. | | @@ -19,8 +19,8 @@ require 'bandwidth-sdk' instance = Bandwidth::MultiChannelActionCalendarEvent.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, title: Meeting with John, start_time: 2022-09-14T18:20:16Z, end_time: 2022-09-14T18:20:16Z, diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index cdf5e020..107a150e 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | ## Example @@ -15,8 +15,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionBase.new( type: null, - text: Hello world, - postback_data: [B@11fa11b2 + text: Track my order, + postback_data: track-order-43654 ) ``` diff --git a/docs/RbmActionDial.md b/docs/RbmActionDial.md index f14ab5bf..20a58bc4 100644 --- a/docs/RbmActionDial.md +++ b/docs/RbmActionDial.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **phone_number** | **String** | The phone number to dial. Must be E164 format. | | ## Example @@ -16,8 +16,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionDial.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, phone_number: +15552223333 ) ``` diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index e03b865e..ffa45a62 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **url** | **String** | The URL to open in browser. Must use http:// or https:// scheme. | | | **application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional] | | **webview_view_mode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional] | @@ -18,8 +18,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionOpenUrl.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, url: https://dev.bandwidth.com, application: null, webview_view_mode: null diff --git a/docs/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md index 8457bbdc..327759f9 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **latitude** | **Float** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | | | **longitude** | **Float** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | | | **label** | **String** | The label of the location. | [optional] | @@ -18,8 +18,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionViewLocation.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, latitude: 37.7749, longitude: -122.4194, label: San Francisco diff --git a/docs/RbmSession.md b/docs/RbmSession.md new file mode 100644 index 00000000..595efbc2 --- /dev/null +++ b/docs/RbmSession.md @@ -0,0 +1,26 @@ +# Bandwidth::RbmSession + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **can_initiate** | **Boolean** | 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. | | +| **id** | **String** | 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. | [optional] | +| **type** | **String** | The type of the interactive session. Only present on `session-started` callbacks. | [optional] | +| **start_time** | **Time** | The time the 24-hour session window opened. Only present on `session-started` callbacks. | [optional] | +| **end_time** | **Time** | The time the 24-hour session window closes. Only present on `session-started` callbacks. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RbmSession.new( + can_initiate: false, + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d, + type: INTERACTIVE_SESSION, + start_time: 2026-08-06T09:59:55Z, + end_time: 2026-08-07T09:59:55Z +) +``` + diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 26993828..443e2905 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **text** | **String** | The text associated with the suggestion response. | [optional] | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | [optional] | +| **text** | **String** | The text of the suggestion the user tapped. | [optional] | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | [optional] | | **paired_message_id** | **String** | Corresponding parent message ID (MT). | [optional] | ## Example @@ -14,8 +14,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmSuggestionResponse.new( - text: Yes, I would like to proceed, - postback_data: [B@11fa11b2, + text: Track my order, + postback_data: track-order-43654, paired_message_id: 1752697342534u24xerqdukke523x ) ``` diff --git a/docs/StatusCallbackMessage.md b/docs/StatusCallbackMessage.md index 8774826a..460ca2f5 100644 --- a/docs/StatusCallbackMessage.md +++ b/docs/StatusCallbackMessage.md @@ -17,6 +17,7 @@ | **media** | **Array<String>** | Optional media, not applicable for sms | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] | +| **session** | [**RbmSession**](RbmSession.md) | | [optional] | ## Example @@ -36,7 +37,8 @@ instance = Bandwidth::StatusCallbackMessage.new( tag: custom string, media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority: null, - channel: null + channel: null, + session: null ) ``` diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 9e1b1646..26dd16dc 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -164,6 +164,7 @@ require 'bandwidth-sdk/models/rbm_message_content_text' require 'bandwidth-sdk/models/rbm_message_media' require 'bandwidth-sdk/models/rbm_open_url_enum' +require 'bandwidth-sdk/models/rbm_session' require 'bandwidth-sdk/models/rbm_standalone_card' require 'bandwidth-sdk/models/rbm_suggestion_response' require 'bandwidth-sdk/models/rbm_web_view_enum' diff --git a/lib/bandwidth-sdk/models/callback.rb b/lib/bandwidth-sdk/models/callback.rb index cfb1be70..0bed9415 100644 --- a/lib/bandwidth-sdk/models/callback.rb +++ b/lib/bandwidth-sdk/models/callback.rb @@ -40,6 +40,7 @@ def openapi_discriminator_mapping :'message-sending' => :'StatusCallback', :'message-sent' => :'StatusCallback', :'requested-location-response' => :'InboundCallback', + :'session-started' => :'StatusCallback', :'suggestion-response' => :'InboundCallback' } end diff --git a/lib/bandwidth-sdk/models/inbound_callback_message.rb b/lib/bandwidth-sdk/models/inbound_callback_message.rb index 9dae4746..f9db26b3 100644 --- a/lib/bandwidth-sdk/models/inbound_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_callback_message.rb @@ -49,6 +49,8 @@ class InboundCallbackMessage < ApiModelBase attr_accessor :channel + attr_accessor :session + attr_accessor :content attr_accessor :suggestion_response @@ -93,6 +95,7 @@ def self.attribute_map :'media' => :'media', :'priority' => :'priority', :'channel' => :'channel', + :'session' => :'session', :'content' => :'content', :'suggestion_response' => :'suggestionResponse', :'location_response' => :'locationResponse' @@ -125,6 +128,7 @@ def self.openapi_types :'media' => :'Array