Skip to content
Merged
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
40 changes: 34 additions & 6 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2962,7 +2962,7 @@ components:
description:
type: string
description: A detailed description of the event described by the callback.
example: Message delivered to carrier.
example: Message delivered to handset.
message:
$ref: '#/components/schemas/statusCallbackMessage'
errorCode:
Expand Down Expand Up @@ -3018,7 +3018,11 @@ components:
- `message-sending` indicates that Bandwidth is sending the message to
the upstream provider.

- `message-delivered` indicates that the message was successfully sent.
- `message-sent` indicates that the message has left the Bandwidth
network and is in transit to the provider.

- `message-delivered` indicates that the message was successfully
delivered to handset.

- `message-failed` indicates that the message could not be sent to the
intended recipient.
Expand All @@ -3027,6 +3031,7 @@ components:
recipient.
enum:
- message-sending
- message-sent
- message-delivered
- message-failed
- message-read
Expand Down Expand Up @@ -8712,12 +8717,33 @@ components:
media:
- https://dev.bandwidth.com/images/bandwidth-logo.png
tag: your tag here
messageSentCallbackExample:
summary: An example of a message-sent callback body.
value:
time: '2024-06-25T18:42:36.979456Z'
type: message-sent
to: '+15554443333'
description: Message sent to carrier
message:
id: 1593110555875xo7watq5px6rbe5d
owner: '+15552221111'
applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c
time: '2024-06-25T18:42:35.876906Z'
segmentCount: 1
direction: out
to:
- '+15554443333'
from: '+15552221111'
text: ''
media:
- https://dev.bandwidth.com/images/bandwidth-logo.png
tag: v2 lab
smsMessageDeliveredCallbackExample:
summary: An example of a sms message-delivered callback body.
value:
type: message-delivered
time: '2024-09-14T18:20:11.160744Z'
description: Message delivered to carrier.
description: Message delivered to handset.
to: '+12345678902'
message:
id: 14762070468292kw2fuqty55yp2b2
Expand All @@ -8735,7 +8761,7 @@ components:
value:
type: message-delivered
time: '2024-09-14T18:20:24.160544Z'
description: Message delivered to carrier.
description: Message delivered to handset.
to: '+12345678902'
message:
id: 14762070468292kw2fuqty55yp2b2
Expand All @@ -8755,7 +8781,7 @@ components:
value:
type: message-delivered
time: '2024-09-14T18:20:17.160544Z'
description: Message delivered to carrier.
description: Message delivered to handset.
to: '+12345678902'
message:
id: 14762070468292kw2fuqty55yp2b2
Expand Down Expand Up @@ -9787,7 +9813,7 @@ 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-delivered</code>, <code>message-failed</code> or <code>message-read</code>.
<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><p>Please visit <a
href='/docs/messaging/webhooks/'>Webhooks</a></p>
Expand All @@ -9798,6 +9824,8 @@ components:
examples:
messageSendingCallback:
$ref: '#/components/examples/messageSendingCallbackExample'
messageSentCallback:
$ref: '#/components/examples/messageSentCallbackExample'
smsMessageDeliveredCallback:
$ref: '#/components/examples/smsMessageDeliveredCallbackExample'
mmsMessageDeliveredCallback:
Expand Down
2 changes: 1 addition & 1 deletion docs/RbmActionBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require 'bandwidth-sdk'
instance = Bandwidth::RbmActionBase.new(
type: null,
text: Hello world,
postback_data: [B@3c29f6be
postback_data: [B@5b3c11ce
)
```

2 changes: 1 addition & 1 deletion docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require 'bandwidth-sdk'

instance = Bandwidth::RbmSuggestionResponse.new(
text: Yes, I would like to proceed,
postback_data: [B@3c29f6be,
postback_data: [B@5b3c11ce,
paired_message_id: 1752697342534u24xerqdukke523x
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/StatusCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ instance = Bandwidth::StatusCallback.new(
event_time: 2024-12-02T20:15:58.278Z,
type: null,
to: +15552223333,
description: Message delivered to carrier.,
description: Message delivered to handset.,
message: null,
error_code: 4405,
carrier_name: AT&amp;T
Expand Down
3 changes: 2 additions & 1 deletion lib/bandwidth-sdk/models/status_callback_type_enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
module Bandwidth
class StatusCallbackTypeEnum
MESSAGE_SENDING = 'message-sending'.freeze
MESSAGE_SENT = 'message-sent'.freeze
MESSAGE_DELIVERED = 'message-delivered'.freeze
MESSAGE_FAILED = 'message-failed'.freeze
MESSAGE_READ = 'message-read'.freeze

def self.all_vars
@all_vars ||= [MESSAGE_SENDING, MESSAGE_DELIVERED, MESSAGE_FAILED, MESSAGE_READ].freeze
@all_vars ||= [MESSAGE_SENDING, MESSAGE_SENT, MESSAGE_DELIVERED, MESSAGE_FAILED, MESSAGE_READ].freeze
end

# Builds the enum from string
Expand Down
6 changes: 6 additions & 0 deletions spec/unit/models/status_callback_type_enum_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
expect(Bandwidth::StatusCallbackTypeEnum::MESSAGE_SENDING).to eq('message-sending')
end

it 'defines MESSAGE_SENT' do
expect(Bandwidth::StatusCallbackTypeEnum::MESSAGE_SENT).to eq('message-sent')
end

it 'defines MESSAGE_DELIVERED' do
expect(Bandwidth::StatusCallbackTypeEnum::MESSAGE_DELIVERED).to eq('message-delivered')
end
Expand All @@ -22,6 +26,7 @@
it 'returns every valid enum value' do
expect(Bandwidth::StatusCallbackTypeEnum.all_vars).to eq([
'message-sending',
'message-sent',
'message-delivered',
'message-failed',
'message-read'
Expand All @@ -32,6 +37,7 @@
describe '.build_from_hash' do
it 'returns the value when it matches a valid enum value' do
expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-sending')).to eq('message-sending')
expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-sent')).to eq('message-sent')
expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-delivered')).to eq('message-delivered')
expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-failed')).to eq('message-failed')
expect(Bandwidth::StatusCallbackTypeEnum.build_from_hash('message-read')).to eq('message-read')
Expand Down