[**Documentation**](index.md) *** [Documentation](packages.md) / Vonage SMS # Vonage SMS SDK for Node.js ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vonage/vonage-node-sdk/ci.yml?branch=3.x) [![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk) ![Latest Release](https://img.shields.io/npm/v/@vonage/sms?label=%40vonage%2Fsms&style=flat-square) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md) [![License](https://img.shields.io/npm/l/@vonage/accounts?label=License&style=flat-square)][license] Vonage This is the Vonage SMS SDK for Node.js for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup]. For full API documentation refer to [developer.nexmo.com](https://developer.nexmo.com/). If you are updating from V2 to V3, please check the migration guide found [here](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/sms/v2_TO_v3_MIGRATION_GUIDE.md) * [Installation](#installation) * [Usage](#usage) * [Promises](#promises) * [Testing](#testing) ## Installation We recommend using this SDK as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). Please see the main package for installation. You can also use this SDK standalone if you only need access to just the SMS API. ### With NPM ```bash npm install @vonage/sms ``` ### With Yarn ```bash yarn add @vonage/sms ``` ## Usage ### As part of the Vonage Server SDK If you are using this SDK as part of the Vonage Server SDK, you can access it as the `sms` property off of the client that you instantiate. ```js const { Auth } = require('@vonage/auth'); const { Vonage } = require('@vonage/server-sdk'); const credentials = new Auth({ apiKey: API_KEY, apiSecret: API_SECRET }); const options = {}; const vonage = new Vonage(credentials, options); vonage.sms.listCountrySMS('sms') .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` ### Standalone The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the SMS API. All you need to do is `require('@vonage/sms')`, and use the returned object to create your own client. ```js const { Auth } = require('@vonage/auth'); const { SMS } = require('@vonage/sms'); const credentials = new Auth({ apiKey: API_KEY, apiSecret: API_SECRET }); const options = {}; const smsClient = new SMS(credentials, options); ``` Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options), and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md#options) ## Promises Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use `await` to wait for a response. ```js const resp = await vonage.sms.basicLookup(PHONE_NUMBER) vonage.sms.getAvailableSMS() .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` ## Testing Run: ```bash npm run test ``` [signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk [license]: _media/LICENSE.txt ## Enumerations ### MessageClassEnum Defined in: [packages/sms/lib/enums/MessageClassEnum.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/MessageClassEnum.ts#L6) Enumeration representing the possible message classes. Defines different message classes that can be associated with SMS messages. #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `NUMBER_0` | `0` | Class 0: Flash SMS. | [packages/sms/lib/enums/MessageClassEnum.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/MessageClassEnum.ts#L10) | | `NUMBER_1` | `1` | Class 1: Immediate display (user should be able to read the message instantly). | [packages/sms/lib/enums/MessageClassEnum.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/MessageClassEnum.ts#L15) | | `NUMBER_2` | `2` | Class 2: Mobile equipment-to-mobile equipment (ME-to-ME) communication. | [packages/sms/lib/enums/MessageClassEnum.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/MessageClassEnum.ts#L20) | | `NUMBER_3` | `3` | Class 3: SIM card-based storage. | [packages/sms/lib/enums/MessageClassEnum.ts:25](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/MessageClassEnum.ts#L25) | *** ### SMSStatus Defined in: [packages/sms/lib/enums/SMSStatus.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L9) Enumeration representing possible SMS status codes. Defines different status codes that can be associated with SMS messages. #### Remarks This matches SMSErrors. Since Enums can't be joined, this is here to help check valid statuses #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `ACCOUNT_NOT_ENABLED` | `"11"` | Account Not Enabled For HTTP: Account is not provisioned for the SMS API. | [packages/sms/lib/enums/SMSStatus.ts:68](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L68) | | `BARRED_NUMBER` | `"7"` | Barred Number: The number you're trying to send messages to is blocklisted. | [packages/sms/lib/enums/SMSStatus.ts:48](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L48) | | `INTERNAL_ERROR` | `"5"` | Internal Error: An error occurred while processing the message. | [packages/sms/lib/enums/SMSStatus.ts:38](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L38) | | `INVALID_CALLBACK_URL` | `"23"` | Invalid Callback URL: Callback URL is too long or contains illegal characters. | [packages/sms/lib/enums/SMSStatus.ts:93](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L93) | | `INVALID_CREDENTIALS` | `"4"` | Invalid Credentials: API key and/or secret are incorrect, invalid, or disabled. | [packages/sms/lib/enums/SMSStatus.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L33) | | `INVALID_MESSAGE` | `"6"` | Invalid Message: The platform was unable to process the message. | [packages/sms/lib/enums/SMSStatus.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L43) | | `INVALID_NETWORK_CODE` | `"22"` | Invalid Network Code: Network code is unrecognized or doesn't match the destination. | [packages/sms/lib/enums/SMSStatus.ts:88](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L88) | | `INVALID_PARAM` | `"3"` | Invalid Parameter: The value of one or more parameters is invalid. | [packages/sms/lib/enums/SMSStatus.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L28) | | `INVALID_SENDER_ADDRESS` | `"15"` | Invalid Sender Address: Using a non-authorized sender ID in the 'from' field. | [packages/sms/lib/enums/SMSStatus.ts:83](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L83) | | `INVALID_SIGNATURE` | `"14"` | Invalid Signature: The supplied signature could not be verified. | [packages/sms/lib/enums/SMSStatus.ts:78](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L78) | | `MESSAGE_TOO_LONG` | `"12"` | Message Too Long: Message length exceeds the maximum allowed. | [packages/sms/lib/enums/SMSStatus.ts:73](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L73) | | `MISSING_REQUIRED_PARAM` | `"2"` | Missing Required Parameter: One or more required parameters are missing. | [packages/sms/lib/enums/SMSStatus.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L23) | | `NON_WHITELISTED_DESTINATION` | `"29"` | Non-Whitelisted Destination: Vonage account is in demo mode and requires whitelisted numbers. This error is returned if you attempt to send a message to a number that isn't in your pre-approved destination list. | [packages/sms/lib/enums/SMSStatus.ts:100](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L100) | | `NUMBER_DEACTIVATED` | `"33"` | Number Deactivated: The number you're trying to send messages to is deactivated. | [packages/sms/lib/enums/SMSStatus.ts:110](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L110) | | `PARTNER_ACCOUNT_BARRED` | `"8"` | Partner Account Barred: Your Vonage account has been suspended. | [packages/sms/lib/enums/SMSStatus.ts:53](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L53) | | `PARTNER_QUOTA_VIOLATION` | `"9"` | Partner Quota Violation: Insufficient credit to send the message. | [packages/sms/lib/enums/SMSStatus.ts:58](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L58) | | `SIGNATURE_AND_API_SECRET_DISALLOWED` | `"32"` | Signature And API Secret Disallowed: A signed request may not present an API secret. | [packages/sms/lib/enums/SMSStatus.ts:105](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L105) | | `SUCCESS` | `"0"` | Success: The message was sent successfully. | [packages/sms/lib/enums/SMSStatus.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L13) | | `THROTTLED` | `"1"` | Throttled: Sending SMS faster than the account limit. | [packages/sms/lib/enums/SMSStatus.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L18) | | `TOO_MANY_EXISTING_BINDS` | `"10"` | Too Many Existing Binds: Number of simultaneous connections exceeds account allocation. | [packages/sms/lib/enums/SMSStatus.ts:63](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/SMSStatus.ts#L63) | *** ### TypeEnum Defined in: [packages/sms/lib/enums/TypeEnum.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/TypeEnum.ts#L6) Enumeration representing possible message types for SMS. Defines different message types that can be associated with SMS messages. #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `BINARY` | `"binary"` | Binary: The message body is in binary format. | [packages/sms/lib/enums/TypeEnum.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/TypeEnum.ts#L15) | | `TEXT` | `"text"` | Text: The message body contains standard text. | [packages/sms/lib/enums/TypeEnum.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/TypeEnum.ts#L10) | | `UNICODE` | `"unicode"` | Unicode: The message body is URL-encoded Unicode, valid for various character sets. | [packages/sms/lib/enums/TypeEnum.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/TypeEnum.ts#L20) | ## Classes ### MessageSendAllFailure Defined in: [packages/sms/lib/classes/Error/MessageSendAllFailure.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/MessageSendAllFailure.ts#L9) Class representing a failure when sending all SMS messages. Extends the SMSFailure class and is used to indicate that all SMS messages failed to send. #### Extends - [`SMSFailure`](#smsfailure) #### Constructors ##### Constructor ```ts new MessageSendAllFailure(response): MessageSendAllFailure; ``` Defined in: [packages/sms/lib/classes/Error/MessageSendAllFailure.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/MessageSendAllFailure.ts#L15) Creates an instance of MessageSendAllFailure. ###### Parameters ###### response [`SMSMessages`](#smsmessages) The response containing details about the failed SMS messages. ###### Returns [`MessageSendAllFailure`](#messagesendallfailure) ###### Overrides [`SMSFailure`](#smsfailure).[`constructor`](#constructor-3) #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from [`SMSFailure`](#smsfailure).[`cause`](#cause-2) ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from [`SMSFailure`](#smsfailure).[`message`](#message-2) ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from [`SMSFailure`](#smsfailure).[`name`](#name-2) ##### response ```ts protected response: SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:14](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L14) The response containing details about the SMS messages. ###### Inherited from [`SMSFailure`](#smsfailure).[`response`](#response-2) ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from [`SMSFailure`](#smsfailure).[`stack`](#stack-2) ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: node\_modules/@types/node/globals.d.ts:161 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from [`SMSFailure`](#smsfailure).[`stackTraceLimit`](#stacktracelimit-2) #### Methods ##### getFailedMessages() ```ts getFailedMessages(): ErrorMessage[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:41](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L41) Retrieves an array of failed messages in the response. ###### Returns [`ErrorMessage`](#errormessage)[] An array of failed messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getFailedMessages`](#getfailedmessages-4) ##### getMessages() ```ts getMessages(): ErrorMessage & SMSMessageResponse & object[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L32) Retrieves an array of all messages in the response. ###### Returns An array of all messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getMessages`](#getmessages-4) ##### getResponse() ```ts getResponse(): SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:52](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L52) Retrieves the original response containing details about the SMS messages. ###### Returns [`SMSMessages`](#smsmessages) The original response containing details about the SMS messages. ###### Inherited from [`SMSFailure`](#smsfailure).[`getResponse`](#getresponse-4) ##### getSuccessfulMessages() ```ts getSuccessfulMessages(): Message[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:61](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L61) Retrieves an array of successfully sent messages in the response. ###### Returns [`Message`](#message-3)[] An array of successfully sent messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getSuccessfulMessages`](#getsuccessfulmessages-4) ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: node\_modules/@types/node/globals.d.ts:145 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from [`SMSFailure`](#smsfailure).[`captureStackTrace`](#capturestacktrace-4) ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: node\_modules/@types/node/globals.d.ts:149 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from [`SMSFailure`](#smsfailure).[`prepareStackTrace`](#preparestacktrace-4) *** ### MessageSendPartialFailure Defined in: [packages/sms/lib/classes/Error/MessageSendPartialFailure.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/MessageSendPartialFailure.ts#L9) Class representing a partial failure when sending SMS messages. Extends the SMSFailure class and is used to indicate that some SMS messages failed to send. #### Extends - [`SMSFailure`](#smsfailure) #### Constructors ##### Constructor ```ts new MessageSendPartialFailure(response): MessageSendPartialFailure; ``` Defined in: [packages/sms/lib/classes/Error/MessageSendPartialFailure.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/MessageSendPartialFailure.ts#L15) Creates an instance of MessageSendPartialFailure. ###### Parameters ###### response [`SMSMessages`](#smsmessages) The response containing details about the partially failed SMS messages. ###### Returns [`MessageSendPartialFailure`](#messagesendpartialfailure) ###### Overrides [`SMSFailure`](#smsfailure).[`constructor`](#constructor-3) #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from [`SMSFailure`](#smsfailure).[`cause`](#cause-2) ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from [`SMSFailure`](#smsfailure).[`message`](#message-2) ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from [`SMSFailure`](#smsfailure).[`name`](#name-2) ##### response ```ts protected response: SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:14](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L14) The response containing details about the SMS messages. ###### Inherited from [`SMSFailure`](#smsfailure).[`response`](#response-2) ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from [`SMSFailure`](#smsfailure).[`stack`](#stack-2) ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: node\_modules/@types/node/globals.d.ts:161 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from [`SMSFailure`](#smsfailure).[`stackTraceLimit`](#stacktracelimit-2) #### Methods ##### getFailedMessages() ```ts getFailedMessages(): ErrorMessage[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:41](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L41) Retrieves an array of failed messages in the response. ###### Returns [`ErrorMessage`](#errormessage)[] An array of failed messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getFailedMessages`](#getfailedmessages-4) ##### getMessages() ```ts getMessages(): ErrorMessage & SMSMessageResponse & object[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L32) Retrieves an array of all messages in the response. ###### Returns An array of all messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getMessages`](#getmessages-4) ##### getResponse() ```ts getResponse(): SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:52](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L52) Retrieves the original response containing details about the SMS messages. ###### Returns [`SMSMessages`](#smsmessages) The original response containing details about the SMS messages. ###### Inherited from [`SMSFailure`](#smsfailure).[`getResponse`](#getresponse-4) ##### getSuccessfulMessages() ```ts getSuccessfulMessages(): Message[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:61](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L61) Retrieves an array of successfully sent messages in the response. ###### Returns [`Message`](#message-3)[] An array of successfully sent messages in the response. ###### Inherited from [`SMSFailure`](#smsfailure).[`getSuccessfulMessages`](#getsuccessfulmessages-4) ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: node\_modules/@types/node/globals.d.ts:145 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from [`SMSFailure`](#smsfailure).[`captureStackTrace`](#capturestacktrace-4) ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: node\_modules/@types/node/globals.d.ts:149 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from [`SMSFailure`](#smsfailure).[`prepareStackTrace`](#preparestacktrace-4) *** ### SMS Defined in: [packages/sms/lib/sms.ts:47](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/sms.ts#L47) Client for sending legacy SMS messages using the Vonage API. #### Examples Create a standalone SMS client ```ts import { AlgorithmTypes } from '@vonage/auth'; import { SMS } from '@vonage/sms'; const smsClient = new SMS({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET secret: { secret: VONAGE_SIGNATURE_SECRET algorithm: AlgorithmTypes.sha512hmac }, }); ``` Create an SMS client from the Vonage client ```ts import { AlgorithmTypes } from '@vonage/auth'; import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET secret: { secret: VONAGE_SIGNATURE_SECRET algorithm: AlgorithmTypes.sha512hmac }, }); const smsClient = vonage.sms; ``` #### Extends - [`Client`](Vonage-Server-Client.md#client) #### Constructors ##### Constructor ```ts new SMS(credentials, options?): SMS; ``` Defined in: packages/server-client/dist/lib/client.d.ts:35 Creates a new instance of the Client. ###### Parameters ###### credentials The authentication credentials or an authentication instance. [`AuthInterface`](Vonage-Auth.md#authinterface) | [`AuthParams`](Vonage-Auth.md#authparams) ###### options? [`ConfigParams`](Vonage-Server-Client.md#configparams) Optional configuration settings for the client. ###### Returns [`SMS`](#sms) ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`constructor`](Vonage-Server-Client.md#client#constructor) #### Properties ##### auth ```ts protected auth: AuthInterface; ``` Defined in: packages/server-client/dist/lib/client.d.ts:24 The authentication instance responsible for generating authentication headers and query parameters. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`auth`](Vonage-Server-Client.md#client#auth) ##### authType? ```ts protected optional authType: AuthenticationType = AuthenticationType.BASIC; ``` Defined in: [packages/sms/lib/sms.ts:51](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/sms.ts#L51) ###### See [Client.authType](Vonage-Messages.md#messages#authtype) ###### Overrides [`Client`](Vonage-Server-Client.md#client).[`authType`](Vonage-Server-Client.md#client#authtype) ##### config ```ts protected config: ConfigParams; ``` Defined in: packages/server-client/dist/lib/client.d.ts:28 Configuration settings for the client, including default hosts for various services and other request settings. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`config`](Vonage-Server-Client.md#client#config) ##### transformers ```ts static transformers: object; ``` Defined in: packages/server-client/dist/lib/client.d.ts:11 Static property containing utility transformers. ###### camelCaseObjectKeys ```ts camelCaseObjectKeys: PartialTransformFunction; ``` ###### kebabCaseObjectKeys ```ts kebabCaseObjectKeys: PartialTransformFunction; ``` ###### omit() ```ts omit: (keys, obj) => TransformedObject; ``` ###### Parameters ###### keys `string`[] ###### obj [`ObjectToTransform`](Vonage-Server-Client.md#objecttotransform) ###### Returns [`TransformedObject`](Vonage-Server-Client.md#transformedobject) ###### snakeCaseObjectKeys ```ts snakeCaseObjectKeys: PartialTransformFunction; ``` ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`transformers`](Vonage-Server-Client.md#client#transformers) #### Methods ##### addAuthenticationToRequest() ```ts addAuthenticationToRequest(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:43 Adds the appropriate authentication headers or parameters to the request based on the authentication type. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options to which authentication needs to be added. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The request options with the added authentication. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`addAuthenticationToRequest`](Vonage-Server-Client.md#client#addauthenticationtorequest) ##### addBasicAuthToRequest() ```ts protected addBasicAuthToRequest(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:71 Adds basic authentication headers to the request. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options to which authentication needs to be added. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The request options with the added authentication. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`addBasicAuthToRequest`](Vonage-Server-Client.md#client#addbasicauthtorequest) ##### addJWTToRequest() ```ts protected addJWTToRequest(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:64 Adds a JWT to the request. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options to which authentication needs to be added. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The request options with the added authentication. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`addJWTToRequest`](Vonage-Server-Client.md#client#addjwttorequest) ##### addQueryKeySecretToRequest() ```ts protected addQueryKeySecretToRequest(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:57 Adds API key and secret to the request. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options to which authentication needs to be added. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The request options with the added authentication. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`addQueryKeySecretToRequest`](Vonage-Server-Client.md#client#addquerykeysecrettorequest) ##### addQueryKeySecretToRequestBody() ```ts protected addQueryKeySecretToRequestBody(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:50 Adds API key and secret to the request body. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options to which authentication needs to be added. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The request options with the added authentication. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`addQueryKeySecretToRequestBody`](Vonage-Server-Client.md#client#addquerykeysecrettorequestbody) ##### getConfig() ```ts getConfig(): ConfigParams; ``` Defined in: packages/server-client/dist/lib/client.d.ts:36 ###### Returns [`ConfigParams`](Vonage-Server-Client.md#configparams) ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`getConfig`](Vonage-Server-Client.md#client#getconfig) ##### parseResponse() ```ts protected parseResponse(request, response): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:168 Parses the response based on its content type. ###### Type Parameters ###### T `T` The expected type of the parsed response data. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options. ###### response `Response` The raw response from the request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The parsed response. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`parseResponse`](Vonage-Server-Client.md#client#parseresponse) ##### prepareBody() ```ts protected prepareBody(request): undefined | string; ``` Defined in: packages/server-client/dist/lib/client.d.ts:158 Prepares the body for the request based on the content type. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The request options. ###### Returns `undefined` \| `string` - The prepared request body as a string or undefined. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`prepareBody`](Vonage-Server-Client.md#client#preparebody) ##### prepareRequest() ```ts protected prepareRequest(request): Promise; ``` Defined in: packages/server-client/dist/lib/client.d.ts:151 Prepares the request with necessary headers, authentication, and query parameters. ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The initial request options. ###### Returns `Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\> - The modified request options. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`prepareRequest`](Vonage-Server-Client.md#client#preparerequest) ##### send() ```ts send(params?): Promise; ``` Defined in: [packages/sms/lib/sms.ts:71](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/sms.ts#L71) Sends an SMS message using the legacy Vonage SMS API. ###### Parameters ###### params? [`SMSParams`](#smsparams) The parameters for the SMS message. ###### Returns `Promise`\<[`SMSMessages`](#smsmessages)\> A Promise that resolves to the response containing details about the sent SMS messages. ###### Throws If all SMS messages fail to send. ###### Throws If some SMS messages fail to send. ###### Example ```ts const response = await smsClient.send({ to: TO_NUMBER, from: FROM_NUMBER, text: 'Hello from Vonage SMS API', }); console.log(`Number of messages sent: ${response.messageCount}`);); ``` ##### sendDeleteRequest() ```ts sendDeleteRequest(url): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:78 Sends a DELETE request to the specified URL. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the DELETE request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the DELETE request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendDeleteRequest`](Vonage-Server-Client.md#client#senddeleterequest) ##### sendFormSubmitRequest() ```ts sendFormSubmitRequest(url, payload?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:86 Sends a POST request with form data to the specified URL. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the POST request. ###### payload? `Record`\<`string`, `undefined` \| `string`\> Optional payload containing form data to send with the POST request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the POST request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendFormSubmitRequest`](Vonage-Server-Client.md#client#sendformsubmitrequest) ##### sendGetRequest() ```ts sendGetRequest(url, queryParams?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:94 Sends a GET request to the specified URL with optional query parameters. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the GET request. ###### queryParams? Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the GET request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendGetRequest`](Vonage-Server-Client.md#client#sendgetrequest) ##### sendPatchRequest() ```ts sendPatchRequest(url, payload?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:104 Sends a PATCH request to the specified URL with an optional payload. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the PATCH request. ###### payload? Optional payload to be sent as the body of the PATCH request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the PATCH request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendPatchRequest`](Vonage-Server-Client.md#client#sendpatchrequest) ##### sendPostRequest() ```ts sendPostRequest(url, payload?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:114 Sends a POST request to the specified URL with an optional payload. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the POST request. ###### payload? Optional payload to be sent as the body of the POST request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the POST request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendPostRequest`](Vonage-Server-Client.md#client#sendpostrequest) ##### sendPutRequest() ```ts sendPutRequest(url, payload?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:124 Sends a PUT request to the specified URL with an optional payload. ###### Type Parameters ###### T `T` ###### Parameters ###### url `string` The URL endpoint for the PUT request. ###### payload? Optional payload to be sent as the body of the PUT request. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the PUT request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendPutRequest`](Vonage-Server-Client.md#client#sendputrequest) ##### sendRequest() ```ts sendRequest(request): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:144 Sends a request adding necessary headers, handling authentication, and parsing the response. ###### Type Parameters ###### T `T` ###### Parameters ###### request [`VetchOptions`](Vonage-Vetch.md#vetchoptions) The options defining the request, including URL, method, headers, and data. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The parsed response from the request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendRequest`](Vonage-Server-Client.md#client#sendrequest) ##### sendRequestWithData() ```ts sendRequestWithData( method, url, payload?): Promise>; ``` Defined in: packages/server-client/dist/lib/client.d.ts:135 Sends a request with JSON-encoded data to the specified URL using the provided HTTP method. ###### Type Parameters ###### T `T` ###### Parameters ###### method The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable). [`POST`](Vonage-Vetch.md#httpmethods#post) | [`PUT`](Vonage-Vetch.md#httpmethods#put) | [`PATCH`](Vonage-Vetch.md#httpmethods#patch) ###### url `string` The URL endpoint for the request. ###### payload? Optional payload to be sent as the body of the request, JSON-encoded. ###### Returns `Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\> - The response from the request. ###### Inherited from [`Client`](Vonage-Server-Client.md#client).[`sendRequestWithData`](Vonage-Server-Client.md#client#sendrequestwithdata) ##### verifySignature() ```ts verifySignature( signature, params, signatureSecret, algorithm): boolean; ``` Defined in: [packages/sms/lib/sms.ts:132](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/sms.ts#L132) Verifies the signature of a request using the specified algorithm and signature secret. ###### Parameters ###### signature `string` The signature to be verified. ###### params `Record`\<`string`, `string`\> The request parameters used to generate the signature. ###### signatureSecret `string` The secret key used for generating the signature. ###### algorithm [`AlgorithmTypes`](Vonage-Auth.md#algorithmtypes) The algorithm used for generating the signature. ###### Returns `boolean` `true` if the signature is valid, `false` otherwise. ###### Remarks This will not parse the request parameters from the request object, so you will need to do that yourself. ###### Throws If the provided signature algorithm is not supported. ###### Example ```ts const params = Object.assign(request.query, request.body); const { sig } = params; sms.verifySignature( sig, {}, // request parameters VONAGE_API_SIGNATURE_SECRET, AlgorithmTypes.md5hash, ) === params.sig) { console.log("Valid signature"); } else { console.log("Invalid signature"); } ``` *** ### SMSFailure Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L10) Class representing a failure response when sending SMS messages. Extends the built-in Error class and provides methods for accessing and handling failed SMS messages. #### Extends - `Error` #### Extended by - [`MessageSendAllFailure`](#messagesendallfailure) - [`MessageSendPartialFailure`](#messagesendpartialfailure) #### Constructors ##### Constructor ```ts new SMSFailure(message, response): SMSFailure; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:22](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L22) Creates an instance of SMSFailure. ###### Parameters ###### message `string` The error message. ###### response [`SMSMessages`](#smsmessages) The response containing details about the SMS messages. ###### Returns [`SMSFailure`](#smsfailure) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### response ```ts protected response: SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:14](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L14) The response containing details about the SMS messages. ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: node\_modules/@types/node/globals.d.ts:161 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### getFailedMessages() ```ts getFailedMessages(): ErrorMessage[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:41](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L41) Retrieves an array of failed messages in the response. ###### Returns [`ErrorMessage`](#errormessage)[] An array of failed messages in the response. ##### getMessages() ```ts getMessages(): ErrorMessage & SMSMessageResponse & object[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L32) Retrieves an array of all messages in the response. ###### Returns An array of all messages in the response. ##### getResponse() ```ts getResponse(): SMSMessages; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:52](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L52) Retrieves the original response containing details about the SMS messages. ###### Returns [`SMSMessages`](#smsmessages) The original response containing details about the SMS messages. ##### getSuccessfulMessages() ```ts getSuccessfulMessages(): Message[]; ``` Defined in: [packages/sms/lib/classes/Error/SMSFailure.ts:61](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/classes/Error/SMSFailure.ts#L61) Retrieves an array of successfully sent messages in the response. ###### Returns [`Message`](#message-3)[] An array of successfully sent messages in the response. ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: node\_modules/@types/node/globals.d.ts:145 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: node\_modules/@types/node/globals.d.ts:149 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` ## Type Aliases ### DeliveryReceipt ```ts type DeliveryReceipt = object; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L6) Interface representing a delivery receipt for an SMS message. Describes the structure of a delivery receipt containing information about the message's delivery status. #### Properties ##### apiKey? ```ts optional apiKey: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:50](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L50) The API key that sent the SMS (optional). ##### clientRef? ```ts optional clientRef: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:55](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L55) Your client reference for the message (optional). ##### errCode? ```ts optional errCode: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:45](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L45) The status of the request (optional). ##### messageId? ```ts optional messageId: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:25](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L25) The Vonage ID for this message (optional). ##### messageTimestamp? ```ts optional messageTimestamp: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:60](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L60) The time when Vonage started to push this Delivery Receipt to your webhook endpoint (optional). ##### msisdn? ```ts optional msisdn: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L10) The recipient's phone number in E.164 format (optional). ##### networkCode? ```ts optional networkCode: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L20) The Mobile Country Code Mobile Network Code (MCCMNC) of the carrier (optional). ##### nonce? ```ts optional nonce: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:70](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L70) A random string forming part of the signed set of parameters for validation (optional). ##### price? ```ts optional price: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:30](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L30) The cost of the message (optional). ##### scts? ```ts optional scts: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:40](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L40) When the Delivery Receipt was received from the carrier in YYMMDDHHMM format (optional). ##### sig? ```ts optional sig: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:75](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L75) The hash of the request parameters, a timestamp, and the signature secret (optional). ##### status? ```ts optional status: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:35](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L35) A code explaining the message's delivery status (optional). ##### timestamp? ```ts optional timestamp: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:65](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L65) A Unix timestamp representation of 'messageTimestamp' (optional). ##### to? ```ts optional to: string; ``` Defined in: [packages/sms/lib/types/Responses/DeliveryReceipt.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/DeliveryReceipt.ts#L15) The SenderID set in the 'from' field of the request (optional). *** ### ErrorMessage ```ts type ErrorMessage = object; ``` Defined in: [packages/sms/lib/types/ErrorMessage.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/ErrorMessage.ts#L6) Interface representing an error message. Describes the structure of an error message containing status and error text. #### Properties ##### errorText? ```ts optional errorText: string; ``` Defined in: [packages/sms/lib/types/ErrorMessage.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/ErrorMessage.ts#L15) The error text providing details about the error (optional). ##### status? ```ts optional status: string; ``` Defined in: [packages/sms/lib/types/ErrorMessage.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/ErrorMessage.ts#L10) The status code indicating the error (optional). *** ### InboundMessage ```ts type InboundMessage = object; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L8) Interface representing an inbound SMS message. Describes the structure of an inbound SMS message, including its properties and details. #### Properties ##### api-key ```ts api-key: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L12) The Vonage API Key of the receiving account. ##### concat ```ts concat: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:62](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L62) Indicates whether this is a concatenated message. ##### concat-part ```ts concat-part: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:77](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L77) The number of this part in the concatenated message. ##### concat-ref ```ts concat-ref: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:67](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L67) The transaction reference for concatenated messages. ##### concat-total ```ts concat-total: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:72](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L72) The total number of parts in this concatenated message. ##### data ```ts data: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:82](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L82) The content of this message, if the type is binary. ##### keyword ```ts keyword: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:42](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L42) The first word in the message body, converted to uppercase. ##### message-timestamp ```ts message-timestamp: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:47](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L47) The time when Vonage started to push this Inbound SMS to your webhook endpoint. ##### messageId ```ts messageId: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:27](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L27) The unique ID of the inbound message. ##### msisdn ```ts msisdn: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:17](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L17) The phone number that this inbound message was sent from in E.164 format. ##### nonce ```ts nonce: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:57](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L57) A random string that forms part of the signed set of parameters for validation. ##### text ```ts text: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L32) The message body for this inbound message. ##### timestamp ```ts timestamp: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:52](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L52) A Unix timestamp representation of 'message-timestamp'. ##### to ```ts to: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:22](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L22) The phone number the message was sent to (virtual number) in E.164 format. ##### type ```ts type: TypeEnum | string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:37](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L37) The format of the message body. ##### udh ```ts udh: string; ``` Defined in: [packages/sms/lib/types/InboundMessage.ts:87](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/InboundMessage.ts#L87) The hex encoded User Data Header, if the type is binary. *** ### Message ```ts type Message = SMSMessageResponse & object; ``` Defined in: [packages/sms/lib/types/Message.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Message.ts#L8) Type representing an SMS message. Extends the structure of an SMS message response and includes additional optional properties. #### Type declaration ##### accountRef? ```ts optional accountRef: string; ``` An optional string used to identify separate accounts using the SMS endpoint for billing purposes (optional). ##### clientRef? ```ts optional clientRef: string; ``` Your client reference for the message (optional). ##### messageId? ```ts optional messageId: string; ``` The unique ID of the SMS message (optional). ##### messagePrice? ```ts optional messagePrice: string; ``` The estimated cost of the SMS message (optional). ##### remainingBalance? ```ts optional remainingBalance: string; ``` Your estimated remaining balance after sending the SMS (optional). *** ### ~~SendSMSResponse~~ ```ts type SendSMSResponse = SMSResponse; ``` Defined in: [packages/sms/lib/types/Responses/SendSMSResponse.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SendSMSResponse.ts#L10) Deprecated type alias for `SMSResponse`. Please use `SMSResponse` instead. #### Deprecated Use `SMSResponse` instead. *** ### ~~SMSEmptyResponse~~ ```ts type SMSEmptyResponse = object; ``` Defined in: [packages/sms/lib/types/Responses/SMSEmptyResponse.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSEmptyResponse.ts#L6) Deprecated interface for an empty SMS response. #### Deprecated There is no substitution for this interface. #### Properties ##### ~~errorCode?~~ ```ts optional errorCode: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSEmptyResponse.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSEmptyResponse.ts#L10) The error code, if applicable (optional). ##### ~~errorCodeLabel?~~ ```ts optional errorCodeLabel: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSEmptyResponse.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSEmptyResponse.ts#L15) A label for the error code, if provided (optional). *** ### ~~SMSGeneralResponse~~ ```ts type SMSGeneralResponse = SMSResponse; ``` Defined in: [packages/sms/lib/types/Responses/SMSGeneralResponse.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSGeneralResponse.ts#L10) Deprecated type alias for `SMSResponse`. Please use `SMSResponse` instead. #### Deprecated Use `SMSResponse` instead. *** ### SMSMessageResponse ```ts type SMSMessageResponse = object; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:7](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L7) Interface representing an SMS message response. Describes the structure of a response containing information about an SMS message's status and details. #### Properties ##### account-ref? ```ts optional account-ref: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:46](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L46) An optional string used to identify separate accounts using the SMS endpoint for billing purposes (optional). ##### client-ref? ```ts optional client-ref: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:41](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L41) Your client reference for the message (optional). ##### message-id ```ts message-id: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:16](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L16) The unique ID of the SMS message. ##### message-price ```ts message-price: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:31](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L31) The estimated cost of the SMS message. ##### network ```ts network: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:36](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L36) The estimated ID of the network of the recipient. ##### remaining-balance ```ts remaining-balance: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:26](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L26) Your estimated remaining balance after sending the SMS. ##### status ```ts status: SMSStatus; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:21](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L21) The status of the SMS message. ##### to ```ts to: string; ``` Defined in: [packages/sms/lib/types/Responses/SMSMessageResponse.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSMessageResponse.ts#L11) The recipient's phone number in E.164 format. *** ### SMSMessages ```ts type SMSMessages = SMSResponse & object; ``` Defined in: [packages/sms/lib/types/SMSMessages.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSMessages.ts#L13) Interface representing an SMS response containing multiple messages, including errors. Extends the structure of an SMS response and includes additional properties for message count and an array of messages, which can include both valid messages and error messages. #### Type declaration ##### messageCount ```ts messageCount: number; ``` The count of messages included in the response. ##### messages ```ts messages: Message & ErrorMessage[]; ``` An array of messages, which can include both valid messages and error messages. *** ### SMSParams ```ts type SMSParams = object; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L9) Type representing parameters for sending an SMS. Describes the structure of parameters that can be used when sending an SMS, including sender, recipient, message content, and additional options. #### Properties ##### accountRef? ```ts optional accountRef: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:88](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L88) An optional string used to identify separate accounts using the SMS endpoint for billing purposes (optional). ##### body? ```ts optional body: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:53](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L53) The binary body of the message (optional). ##### callback? ```ts optional callback: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:38](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L38) The webhook callback URL for receiving delivery receipts (optional). ##### clientRef? ```ts optional clientRef: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:83](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L83) Your client reference for the message (optional). ##### contentId? ```ts optional contentId: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:98](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L98) An optional content ID for regulatory requirements (optional). ##### entityId? ```ts optional entityId: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:93](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L93) An optional entity ID for regulatory requirements (optional). ##### from ```ts from: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L13) The sender's phone number or name. ##### messageClass? ```ts optional messageClass: MessageClassEnum; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L43) The message class (optional). ##### protocolId? ```ts optional protocolId: number; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:63](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L63) The protocol identifier for binary messages (optional). ##### statusReportReq? ```ts optional statusReportReq: boolean; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L33) Indicates if a delivery receipt is requested (optional). ##### text? ```ts optional text: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L23) The text content of the SMS message (optional). ##### title? ```ts optional title: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:68](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L68) The title of the message (optional). ##### to ```ts to: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L18) The recipient's phone number in E.164 format. ##### ttl? ```ts optional ttl: number; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L28) The time-to-live (TTL) duration in milliseconds for delivery attempts (optional). ##### type? ```ts optional type: TypeEnum; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:48](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L48) The format of the message body (optional). ##### udh? ```ts optional udh: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:58](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L58) The User Data Header (UDH) for binary messages (optional). ##### url? ```ts optional url: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:73](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L73) The URL for WAP Push messages (optional). ##### validity? ```ts optional validity: string; ``` Defined in: [packages/sms/lib/types/SMSParams.ts:78](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/SMSParams.ts#L78) The validity period of the message (optional). *** ### SMSRequestBody ```ts type SMSRequestBody = object; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L8) Interface representing the request body for sending an SMS. Describes the structure of the request body used when sending an SMS message. #### Properties ##### body? ```ts optional body: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L28) Hex-encoded binary data (optional). ##### callback? ```ts callback?: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:48](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L48) The webhook endpoint for the delivery receipt (optional). ##### client\_ref? ```ts client_ref?: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L43) Your own reference for the message (optional). ##### client-ref? ```ts optional client-ref: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:78](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L78) Your own reference for the message (optional). ##### content-id? ```ts optional content-id: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:88](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L88) A string parameter for regulatory requirements (optional). ##### entity-id? ```ts optional entity-id: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:83](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L83) A string parameter for regulatory requirements (optional). ##### from ```ts from: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L18) The Alphanumeric senderID (if supported for the destination) or virtual number (specified in E.164 format) that the SMS is being sent from. ##### message\_class? ```ts message_class?: number; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:53](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L53) The Data Coding Scheme value of the message (optional). ##### message-class? ```ts optional message-class: MessageClassEnum; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:73](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L73) The Data Coding Scheme value of the message (optional). ##### protocol-id? ```ts optional protocol-id: number; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:63](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L63) The value of the protocol identifier to use (optional). ##### status-report-req? ```ts optional status-report-req: boolean; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:68](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L68) Boolean indicating if a Delivery Receipt is requested (optional). ##### text? ```ts optional text: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L23) The body of the message being sent (optional). ##### to ```ts to: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L12) The recipient's phone number in E.164 format. ##### ttl? ```ts ttl?: number; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:38](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L38) The duration in milliseconds for delivery attempts (optional). ##### type? ```ts type?: TypeEnum; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L33) The format of the message body (optional). ##### udh? ```ts udh?: string; ``` Defined in: [packages/sms/lib/types/Requests/SMSRequestBody.ts:58](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Requests/SMSRequestBody.ts#L58) Custom Hex-encoded User Data Header (optional). *** ### SMSResponse ```ts type SMSResponse = object; ``` Defined in: [packages/sms/lib/types/Responses/SMSResponse.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSResponse.ts#L9) Interface representing an SMS response. Describes the structure of a response containing information about SMS messages or error messages. #### Properties ##### message-count ```ts message-count: number; ``` Defined in: [packages/sms/lib/types/Responses/SMSResponse.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSResponse.ts#L13) The count of messages included in the response. ##### messages ```ts messages: | SMSMessageResponse[] | SMSErrorMessageResponse[]; ``` Defined in: [packages/sms/lib/types/Responses/SMSResponse.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/types/Responses/SMSResponse.ts#L18) An array of SMS message responses or SMS error message responses. ## Variables ### COLLECTION\_FORMATS ```ts const COLLECTION_FORMATS: object; ``` Defined in: [packages/sms/lib/enums/CollectionFormats.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/sms/lib/enums/CollectionFormats.ts#L6) Collection Formats for API Parameter Serialization. Defines various collection formats used for serializing API parameters. #### Type declaration ##### csv ```ts csv: string = ','; ``` Comma-separated values collection format. ##### pipes ```ts pipes: string = '|'; ``` Pipe-separated values collection format. ##### ssv ```ts ssv: string = ' '; ``` Space-separated values collection format. ##### tsv ```ts tsv: string = '\t'; ``` Tab-separated values collection format.