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
57 changes: 57 additions & 0 deletions packages/sms/__tests__/__dataSets__/sms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,61 @@ export default [
} as SMSParams,
],
},
{
label: 'send message with number pool',
request: [
'/sms/json',
'POST',
{
'from': '12126875309',
'to': '14152739164',
'text': 'too many secrets',
'pool-id': 'abc123'

},
],
response: [
200,
{
'message-count': 1,
messages: [
{
to: '14152739164',
'message-id': '986ebc8e-46de-4f80-88e4-21d4c5d0c0a6',
status: SMSStatus.SUCCESS,
'remaining-balance': '0.42',
'message-price': '0.84',
network: '123456',
} as SMSMessageResponse,
],
} as SMSResponse,
],
method: 'post',
clientMethod: 'send',
parameters: [
{
from: '12126875309',
to: '14152739164',
text: 'too many secrets',
poolId: 'abc123',
} as SMSParams,
],
expected: {
'message-count': 1,
messageCount: 1,
messages: [
{
to: '14152739164',
'message-id': '986ebc8e-46de-4f80-88e4-21d4c5d0c0a6',
messageId: '986ebc8e-46de-4f80-88e4-21d4c5d0c0a6',
status: SMSStatus.SUCCESS,
'remaining-balance': '0.42',
remainingBalance: '0.42',
'message-price': '0.84',
messagePrice: '0.84',
network: '123456',
} as SMSMessageResponse,
],
} as SMSMessages,
}
];
10 changes: 10 additions & 0 deletions packages/sms/lib/types/SMSParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,14 @@ export type SMSParams = {
* accounts subscribed to Fraud Defender Premium.
*/
trustedNumber?: boolean

/**
* The ID of the Number Pool to use as the sender of this message. If
* specified, a number from the pool will be used as the from number. The
* from parameter is still required even when specifying a pool-id and will
* be used as a fall-back if the number pool cannot be used.
*
* @see https://developer.vonage.com/en/numbers/number-pools-api/overview
*/
poolId?: string;
}
Loading