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
20 changes: 13 additions & 7 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2889,6 +2889,11 @@ components:
example: Yes, I would like to proceed
postbackData:
$ref: '#/components/schemas/rbmActionPostbackData'
pairedMessageId:
type: string
nullable: true
description: Corresponding parent message ID (MT).
example: 1752697342534u24xerqdukke523x
rbmLocationResponse:
type: object
properties:
Expand Down Expand Up @@ -2925,7 +2930,7 @@ components:
message-failed: '#/components/schemas/statusCallback'
message-read: '#/components/schemas/statusCallback'
message-received: '#/components/schemas/inboundCallback'
request-location-response: '#/components/schemas/inboundCallback'
requested-location-response: '#/components/schemas/inboundCallback'
suggestion-response: '#/components/schemas/inboundCallback'
statusCallback:
type: object
Expand Down Expand Up @@ -3035,14 +3040,15 @@ components:
- `message-received` indicates an MO message from a Bandwidth user's
client to a Bandwidth number.

- `request-location-response` indicates a response to a location request
sent by the Bandwidth user's client after receiving an RBM message.
- `requested-location-response` indicates a response to a location
request sent by the Bandwidth user's client after receiving an RBM
message.

- `suggestion-response` indicates a response to a suggestion sent by the
Bandwidth user's client after receiving an RBM message.
enum:
- message-received
- request-location-response
- requested-location-response
- suggestion-response
example: message-received
statusCallbackMessage:
Expand Down Expand Up @@ -9154,7 +9160,7 @@ components:
tag: '{"myTag": "myTagValue"}'
updateEndpointBxmlRequestExample:
summary: Update Endpoint BXML Request Example
value: <Bxml><StartRecording /></Bxml>
value: <Response><StartRecording /></Response>
endpointDisconnectedEventExample:
summary: Endpoint Disconnected Event
value:
Expand Down Expand Up @@ -9678,10 +9684,10 @@ components:

<p>The payload type will be one of <code>message-received</code>,
<code>suggestion-response</code>, or
<code>location-request-response</code>.
<code>requested-location-response</code>.

<p>Note that <code>suggestion-response</code> and
<code>location-request-response</code> callback types are
<code>requested-location-response</code> callback types are
pertinent only for RBM messages sent from the
<code>/messages/multiChannel</code> endpoint.

Expand Down
4 changes: 2 additions & 2 deletions docs/InboundCallbackTypeEnum.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# InboundCallbackTypeEnum

The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user\'s client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user\'s client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user\'s client after receiving an RBM message.
The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user\'s client to a Bandwidth number. - `requested-location-response` indicates a response to a location request sent by the Bandwidth user\'s client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user\'s client after receiving an RBM message.

## Enum

* `MessageReceived` (value: `'message-received'`)

* `RequestLocationResponse` (value: `'request-location-response'`)
* `RequestedLocationResponse` (value: `'requested-location-response'`)

* `SuggestionResponse` (value: `'suggestion-response'`)

Expand Down
2 changes: 2 additions & 0 deletions docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**text** | **string** | The text associated with the suggestion response. | [optional] [default to undefined]
**postbackData** | **string** | Base64 payload the customer receives when the reply is clicked. | [optional] [default to undefined]
**pairedMessageId** | **string** | Corresponding parent message ID (MT). | [optional] [default to undefined]

## Example

Expand All @@ -16,6 +17,7 @@ import { RbmSuggestionResponse } from 'bandwidth-sdk';
const instance: RbmSuggestionResponse = {
text,
postbackData,
pairedMessageId,
};
```

Expand Down
2 changes: 1 addition & 1 deletion models/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ import type { StatusCallback } from './status-callback';
* @type Callback
* Callbacks are divided into two types based on direction of the related message: - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client\'s response to a suggestion or location request.
*/
export type Callback = { type: 'message-delivered' } & StatusCallback | { type: 'message-failed' } & StatusCallback | { type: 'message-read' } & StatusCallback | { type: 'message-received' } & InboundCallback | { type: 'message-sending' } & StatusCallback | { type: 'message-sent' } & StatusCallback | { type: 'request-location-response' } & InboundCallback | { type: 'suggestion-response' } & InboundCallback;
export type Callback = { type: 'message-delivered' } & StatusCallback | { type: 'message-failed' } & StatusCallback | { type: 'message-read' } & StatusCallback | { type: 'message-received' } & InboundCallback | { type: 'message-sending' } & StatusCallback | { type: 'message-sent' } & StatusCallback | { type: 'requested-location-response' } & InboundCallback | { type: 'suggestion-response' } & InboundCallback;


4 changes: 2 additions & 2 deletions models/inbound-callback-type-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@


/**
* The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user\'s client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user\'s client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user\'s client after receiving an RBM message.
* The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user\'s client to a Bandwidth number. - `requested-location-response` indicates a response to a location request sent by the Bandwidth user\'s client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user\'s client after receiving an RBM message.
*/

export const InboundCallbackTypeEnum = {
MessageReceived: 'message-received',
RequestLocationResponse: 'request-location-response',
RequestedLocationResponse: 'requested-location-response',
SuggestionResponse: 'suggestion-response'
} as const;

Expand Down
4 changes: 4 additions & 0 deletions models/rbm-suggestion-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ export interface RbmSuggestionResponse {
* Base64 payload the customer receives when the reply is clicked.
*/
'postbackData'?: string;
/**
* Corresponding parent message ID (MT).
*/
'pairedMessageId'?: string | null;
}

4 changes: 2 additions & 2 deletions tests/unit/models/inbound-callback-type-enum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { InboundCallbackTypeEnum } from '../../../models/inbound-callback-type-e
describe('InboundCallbackTypeEnum', () => {
test('should define the expected values', () => {
expect(InboundCallbackTypeEnum.MessageReceived).toBe('message-received');
expect(InboundCallbackTypeEnum.RequestLocationResponse).toBe('request-location-response');
expect(InboundCallbackTypeEnum.RequestedLocationResponse).toBe('requested-location-response');
expect(InboundCallbackTypeEnum.SuggestionResponse).toBe('suggestion-response');
expect(Object.values(InboundCallbackTypeEnum)).toEqual([
'message-received',
'request-location-response',
'requested-location-response',
'suggestion-response'
]);
});
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/models/rbm-suggestion-response.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ describe('RbmSuggestionResponse', () => {
const fixture: RbmSuggestionResponse = {
text: 'test-text',
postbackData: 'test-postbackData',
pairedMessageId: 'test-pairedMessageId'
};

expect(fixture.text).toBe('test-text');
expect(fixture.postbackData).toBe('test-postbackData');
expect(fixture.pairedMessageId).toBe('test-pairedMessageId');
});
});