twilio 4.10.0 → 4.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +151 -30
  2. package/lib/rest/NumbersBase.d.ts +3 -0
  3. package/lib/rest/NumbersBase.js +5 -0
  4. package/lib/rest/conversations/v1/addressConfiguration.d.ts +8 -0
  5. package/lib/rest/conversations/v1/addressConfiguration.js +4 -0
  6. package/lib/rest/conversations/v1/conversation.d.ts +6 -6
  7. package/lib/rest/conversations/v1/service/conversation.d.ts +6 -6
  8. package/lib/rest/flexApi/v1/assessments.d.ts +24 -28
  9. package/lib/rest/flexApi/v1/assessments.js +28 -36
  10. package/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts +12 -16
  11. package/lib/rest/flexApi/v1/insightsAssessmentsComment.js +7 -15
  12. package/lib/rest/flexApi/v1/insightsConversations.d.ts +6 -6
  13. package/lib/rest/flexApi/v1/insightsConversations.js +2 -2
  14. package/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts +27 -27
  15. package/lib/rest/flexApi/v1/insightsQuestionnaires.js +32 -30
  16. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts +21 -21
  17. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js +23 -23
  18. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +31 -31
  19. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +30 -30
  20. package/lib/rest/flexApi/v1/insightsSegments.d.ts +62 -126
  21. package/lib/rest/flexApi/v1/insightsSegments.js +42 -99
  22. package/lib/rest/flexApi/v1/insightsSettingsAnswerSets.d.ts +2 -2
  23. package/lib/rest/flexApi/v1/insightsSettingsAnswerSets.js +3 -3
  24. package/lib/rest/flexApi/v1/insightsSettingsComment.d.ts +2 -2
  25. package/lib/rest/flexApi/v1/insightsSettingsComment.js +3 -3
  26. package/lib/rest/insights/v1/callSummaries.d.ts +24 -0
  27. package/lib/rest/insights/v1/callSummaries.js +8 -0
  28. package/lib/rest/messaging/V1.d.ts +5 -5
  29. package/lib/rest/messaging/V1.js +8 -7
  30. package/lib/rest/messaging/v1/domainConfig.d.ts +33 -11
  31. package/lib/rest/messaging/v1/domainConfig.js +13 -10
  32. package/lib/rest/messaging/v1/domainConfigMessagingService.d.ts +6 -0
  33. package/lib/rest/messaging/v1/domainConfigMessagingService.js +2 -0
  34. package/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.d.ts +91 -0
  35. package/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.js +112 -0
  36. package/lib/rest/numbers/V1.d.ts +15 -0
  37. package/lib/rest/numbers/V1.js +37 -0
  38. package/lib/rest/numbers/v1/bulkEligibility.d.ts +112 -0
  39. package/lib/rest/numbers/v1/bulkEligibility.js +118 -0
  40. package/lib/rest/verify/v2/service.d.ts +3 -3
  41. package/lib/rest/verify/v2/template.d.ts +5 -5
  42. package/lib/twiml/VoiceResponse.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +0 -521
  45. package/lib/rest/messaging/v1/tollfreeVerification.js +0 -396
package/README.md CHANGED
@@ -19,17 +19,45 @@ The Node library documentation can be found [here][libdocs].
19
19
 
20
20
  This library supports the following Node.js implementations:
21
21
 
22
- * Node.js 14
23
- * Node.js 16
24
- * Node.js 18
22
+ - Node.js 14
23
+ - Node.js 16
24
+ - Node.js 18
25
25
 
26
26
  TypeScript is supported for TypeScript version 2.9 and above.
27
27
 
28
+ > **Warning**
29
+ > Do not use this Node.js library in a front-end application. Doing so can expose your Twilio credentials to end-users as part of the bundled HTML/JavaScript sent to their browser.
30
+
28
31
  ## Installation
29
32
 
30
33
  `npm install twilio` or `yarn add twilio`
31
34
 
32
- ## Sample Usage
35
+ ### Test your installation
36
+
37
+ To make sure the installation was successful, try sending yourself an SMS message, like this:
38
+
39
+ ```js
40
+ // Your AccountSID and Auth Token from console.twilio.com
41
+ const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
42
+ const authToken = 'your_auth_token';
43
+
44
+ const client = require('twilio')(accountSid, authToken);
45
+
46
+ client.messages
47
+ .create({
48
+ body: 'Hello from twilio-node',
49
+ to: '+12345678901', // Text your number
50
+ from: '+12345678901', // From a valid Twilio number
51
+ })
52
+ .then((message) => console.log(message.sid));
53
+ ```
54
+
55
+ After a brief delay, you will receive the text message on your phone.
56
+
57
+ > **Warning**
58
+ > It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production. Check out [How to Set Environment Variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) for more information.
59
+
60
+ ## Usage
33
61
 
34
62
  Check out these [code examples](examples) in JavaScript and TypeScript to get up and running quickly.
35
63
 
@@ -40,27 +68,31 @@ Check out these [code examples](examples) in JavaScript and TypeScript to get up
40
68
  If your environment requires SSL decryption, you can set the path to CA bundle in the env var `TWILIO_CA_BUNDLE`.
41
69
 
42
70
  ### Client Initialization
71
+
43
72
  If you invoke any V2010 operations without specifying an account SID, `twilio-node` will automatically use the `TWILIO_ACCOUNT_SID` value that the client was initialized with. This is useful for when you'd like to, for example, fetch resources for your main account but also your subaccount. See below:
44
73
 
45
74
  ```javascript
46
- var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
47
- var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
48
- var subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID; // Your Subaccount SID from www.twilio.com/console
75
+ // Your Account SID, Subaccount SID Auth Token from console.twilio.com
76
+ const accountSid = process.env.TWILIO_ACCOUNT_SID;
77
+ const authToken = process.env.TWILIO_AUTH_TOKEN;
78
+ const subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID;
49
79
 
50
80
  const client = require('twilio')(accountSid, authToken);
51
81
  const mainAccountCalls = client.api.v2010.account.calls.list; // SID not specified, so defaults to accountSid
52
- const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list // SID specified as subaccountSid
82
+ const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list; // SID specified as subaccountSid
53
83
  ```
54
84
 
55
85
  ### Lazy Loading
56
86
 
57
87
  `twilio-node` supports lazy loading required modules for faster loading time. Lazy loading is enabled by default. To disable lazy loading, simply instantiate the Twilio client with the `lazyLoading` flag set to `false`:
88
+
58
89
  ```javascript
59
- var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
60
- var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
90
+ // Your Account SID and Auth Token from console.twilio.com
91
+ const accountSid = process.env.TWILIO_ACCOUNT_SID;
92
+ const authToken = process.env.TWILIO_AUTH_TOKEN;
61
93
 
62
94
  const client = require('twilio')(accountSid, authToken, {
63
- lazyLoading: false
95
+ lazyLoading: false,
64
96
  });
65
97
  ```
66
98
 
@@ -71,12 +103,12 @@ const client = require('twilio')(accountSid, authToken, {
71
103
  Optionally, the maximum number of retries performed by this feature can be set with the `maxRetries` flag. The default maximum number of retries is `3`.
72
104
 
73
105
  ```javascript
74
- var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
75
- var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
106
+ const accountSid = process.env.TWILIO_ACCOUNT_SID;
107
+ const authToken = process.env.TWILIO_AUTH_TOKEN;
76
108
 
77
109
  const client = require('twilio')(accountSid, authToken, {
78
- autoRetry: true,
79
- maxRetries: 3
110
+ autoRetry: true,
111
+ maxRetries: 3,
80
112
  });
81
113
  ```
82
114
 
@@ -85,12 +117,12 @@ const client = require('twilio')(accountSid, authToken, {
85
117
  To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and/or Edge for the client:
86
118
 
87
119
  ```javascript
88
- var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
89
- var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
120
+ const accountSid = process.env.TWILIO_ACCOUNT_SID;
121
+ const authToken = process.env.TWILIO_AUTH_TOKEN;
90
122
 
91
123
  const client = require('twilio')(accountSid, authToken, {
92
- region: 'au1',
93
- edge: 'sydney',
124
+ region: 'au1',
125
+ edge: 'sydney',
94
126
  });
95
127
  ```
96
128
 
@@ -104,34 +136,123 @@ client.edge = 'sydney';
104
136
 
105
137
  This will result in the `hostname` transforming from `api.twilio.com` to `api.sydney.au1.twilio.com`.
106
138
 
139
+ ### Iterate through records
140
+
141
+ The library automatically handles paging for you. Collections, such as `calls` and `messages`, have `list` and `each` methods that page under the hood. With both `list` and `each`, you can specify the number of records you want to receive (`limit`) and the maximum size you want each page fetch to be (`pageSize`). The library will then handle the task for you.
142
+
143
+ `list` eagerly fetches all records and returns them as a list, whereas `each` streams records and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the `page` method.
144
+
145
+ For more information about these methods, view the [auto-generated library docs](https://www.twilio.com/docs/libraries/reference/twilio-node/).
146
+
147
+ ```js
148
+ // Your Account SID and Auth Token from console.twilio.com
149
+ const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
150
+ const authToken = 'your_auth_token';
151
+ const client = require('twilio')(accountSid, authToken);
152
+
153
+ client.calls.each((call) => console.log(call.direction));
154
+ ```
155
+
107
156
  ### Enable Debug Logging
157
+
108
158
  There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called `TWILIO_LOG_LEVEL` and set it to `debug` or you can set the logLevel variable on the client as debug:
159
+
109
160
  ```javascript
110
- var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
111
- var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
161
+ const accountSid = process.env.TWILIO_ACCOUNT_SID;
162
+ const authToken = process.env.TWILIO_AUTH_TOKEN;
112
163
 
113
164
  const client = require('twilio')(accountSid, authToken, {
114
- logLevel: 'debug'
165
+ logLevel: 'debug',
115
166
  });
116
167
  ```
168
+
117
169
  You can also set the logLevel variable on the client after constructing the Twilio client:
170
+
118
171
  ```javascript
119
172
  const client = require('twilio')(accountSid, authToken);
120
173
  client.logLevel = 'debug';
121
174
  ```
122
175
 
123
- ## Using webhook validation
124
- See [example](examples/express.js) for a code sample for incoming Twilio request validation.
176
+ ### Debug API requests
125
177
 
126
- ## Handling Exceptions
178
+ To assist with debugging, the library allows you to access the underlying request and response objects. This capability is built into the default HTTP client that ships with the library.
127
179
 
128
- For an example on how to handle exceptions in this helper library, please see the [Twilio documentation](https://www.twilio.com/docs/libraries/node#exceptions).
180
+ For example, you can retrieve the status code of the last response like so:
129
181
 
130
- ## Using a Custom HTTP Client
182
+ ```js
183
+ const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
184
+ const authToken = 'your_auth_token';
131
185
 
132
- To use a custom HTTP client with this helper library, please see the [Twilio documentation](https://www.twilio.com/docs/libraries/node/custom-http-clients-node).
186
+ const client = require('twilio')(accountSid, authToken);
187
+
188
+ client.messages
189
+ .create({
190
+ to: '+14158675309',
191
+ from: '+14258675310',
192
+ body: 'Ahoy!',
193
+ })
194
+ .then(() => {
195
+ // Access details about the last request
196
+ console.log(client.lastRequest.method);
197
+ console.log(client.lastRequest.url);
198
+ console.log(client.lastRequest.auth);
199
+ console.log(client.lastRequest.params);
200
+ console.log(client.lastRequest.headers);
201
+ console.log(client.lastRequest.data);
202
+
203
+ // Access details about the last response
204
+ console.log(client.httpClient.lastResponse.statusCode);
205
+ console.log(client.httpClient.lastResponse.body);
206
+ });
207
+ ```
208
+
209
+ ### Handle exceptions
210
+
211
+ If the Twilio API returns a 400 or a 500 level HTTP response, `twilio-node` will throw an error including relevant information, which you can then `catch`:
212
+
213
+ ```js
214
+ client.messages
215
+ .create({
216
+ body: 'Hello from Node',
217
+ to: '+12345678901',
218
+ from: '+12345678901',
219
+ })
220
+ .then((message) => console.log(message))
221
+ .catch((error) => {
222
+ // You can implement your fallback code here
223
+ console.log(error);
224
+ });
225
+ ```
226
+
227
+ or with `async/await`:
228
+
229
+ ```js
230
+ try {
231
+ const message = await client.messages.create({
232
+ body: 'Hello from Node',
233
+ to: '+12345678901',
234
+ from: '+12345678901',
235
+ });
236
+ console.log(message);
237
+ } catch (error) {
238
+ // You can implement your fallback code here
239
+ console.error(error);
240
+ }
241
+ ```
242
+
243
+ If you are using callbacks, error information will be included in the `error` parameter of the callback.
244
+
245
+ 400-level errors are [normal during API operation](https://www.twilio.com/docs/api/rest/request#get-responses) ("Invalid number", "Cannot deliver SMS to that number", for example) and should be handled appropriately.
246
+
247
+ ### Use a custom HTTP Client
248
+
249
+ To use a custom HTTP client with this helper library, please see the [advanced example of how to do so](./advanced-examples/custom-http-client.md).
250
+
251
+ ### Use webhook validation
252
+
253
+ See [example](examples/express.js) for a code sample for incoming Twilio request validation.
133
254
 
134
- ## Docker Image
255
+ ## Docker image
135
256
 
136
257
  The `Dockerfile` present in this repository and its respective `twilio/twilio-node` Docker image are currently used by Twilio for testing purposes only.
137
258
 
@@ -149,7 +270,7 @@ Bug fixes, docs, and library improvements are always welcome. Please refer to ou
149
270
 
150
271
  If you're not familiar with the GitHub pull request/contribution process, [this is a nice tutorial](https://gun.io/blog/how-to-github-fork-branch-and-pull-request/).
151
272
 
152
- #### Getting Started
273
+ ### Get started
153
274
 
154
275
  If you want to familiarize yourself with the project, you can start by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [cloning it in your local development environment](https://help.github.com/articles/cloning-a-repository/). The project requires [Node.js](https://nodejs.org) to be installed on your machine.
155
276
 
@@ -1,6 +1,8 @@
1
1
  import Domain from "../base/Domain";
2
+ import V1 from "./numbers/V1";
2
3
  import V2 from "./numbers/V2";
3
4
  declare class NumbersBase extends Domain {
5
+ _v1?: V1;
4
6
  _v2?: V2;
5
7
  /**
6
8
  * Initialize numbers domain
@@ -8,6 +10,7 @@ declare class NumbersBase extends Domain {
8
10
  * @param twilio - The twilio client
9
11
  */
10
12
  constructor(twilio: any);
13
+ get v1(): V1;
11
14
  get v2(): V2;
12
15
  }
13
16
  export = NumbersBase;
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  const Domain_1 = __importDefault(require("../base/Domain"));
16
+ const V1_1 = __importDefault(require("./numbers/V1"));
16
17
  const V2_1 = __importDefault(require("./numbers/V2"));
17
18
  class NumbersBase extends Domain_1.default {
18
19
  /**
@@ -23,6 +24,10 @@ class NumbersBase extends Domain_1.default {
23
24
  constructor(twilio) {
24
25
  super(twilio, "https://numbers.twilio.com");
25
26
  }
27
+ get v1() {
28
+ this._v1 = this._v1 || new V1_1.default(this);
29
+ return this._v1;
30
+ }
26
31
  get v2() {
27
32
  this._v2 = this._v2 || new V2_1.default(this);
28
33
  return this._v2;
@@ -55,6 +55,8 @@ export interface AddressConfigurationListInstanceCreateOptions {
55
55
  "autoCreation.studioFlowSid"?: string;
56
56
  /** For type `studio`, number of times to retry the webhook request */
57
57
  "autoCreation.studioRetryCount"?: number;
58
+ /** An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. */
59
+ addressCountry?: string;
58
60
  }
59
61
  /**
60
62
  * Options to pass to each
@@ -167,6 +169,7 @@ interface AddressConfigurationResource {
167
169
  date_created: Date;
168
170
  date_updated: Date;
169
171
  url: string;
172
+ address_country: string;
170
173
  }
171
174
  export declare class AddressConfigurationInstance {
172
175
  protected _version: V1;
@@ -209,6 +212,10 @@ export declare class AddressConfigurationInstance {
209
212
  * An absolute API resource URL for this address configuration.
210
213
  */
211
214
  url: string;
215
+ /**
216
+ * An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
217
+ */
218
+ addressCountry: string;
212
219
  private get _proxy();
213
220
  /**
214
221
  * Remove a AddressConfigurationInstance
@@ -258,6 +265,7 @@ export declare class AddressConfigurationInstance {
258
265
  dateCreated: Date;
259
266
  dateUpdated: Date;
260
267
  url: string;
268
+ addressCountry: string;
261
269
  };
262
270
  [inspect.custom](_depth: any, options: InspectOptions): string;
263
271
  }
@@ -117,6 +117,7 @@ class AddressConfigurationInstance {
117
117
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
118
118
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
119
119
  this.url = payload.url;
120
+ this.addressCountry = payload.address_country;
120
121
  this._solution = { sid: sid || this.sid };
121
122
  }
122
123
  get _proxy() {
@@ -164,6 +165,7 @@ class AddressConfigurationInstance {
164
165
  dateCreated: this.dateCreated,
165
166
  dateUpdated: this.dateUpdated,
166
167
  url: this.url,
168
+ addressCountry: this.addressCountry,
167
169
  };
168
170
  }
169
171
  [util_1.inspect.custom](_depth, options) {
@@ -212,6 +214,8 @@ function AddressConfigurationListInstance(version) {
212
214
  if (params["autoCreation.studioRetryCount"] !== undefined)
213
215
  data["AutoCreation.StudioRetryCount"] =
214
216
  params["autoCreation.studioRetryCount"];
217
+ if (params["addressCountry"] !== undefined)
218
+ data["AddressCountry"] = params["addressCountry"];
215
219
  const headers = {};
216
220
  headers["Content-Type"] = "application/x-www-form-urlencoded";
217
221
  let operationVersion = version, operationPromise = operationVersion.create({
@@ -69,9 +69,9 @@ export interface ConversationListInstanceCreateOptions {
69
69
  * Options to pass to each
70
70
  */
71
71
  export interface ConversationListInstanceEachOptions {
72
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
72
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
73
73
  startDate?: string;
74
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
74
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
75
75
  endDate?: string;
76
76
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
77
77
  state?: ConversationState;
@@ -88,9 +88,9 @@ export interface ConversationListInstanceEachOptions {
88
88
  * Options to pass to list
89
89
  */
90
90
  export interface ConversationListInstanceOptions {
91
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
91
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
92
92
  startDate?: string;
93
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
93
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
94
94
  endDate?: string;
95
95
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
96
96
  state?: ConversationState;
@@ -103,9 +103,9 @@ export interface ConversationListInstanceOptions {
103
103
  * Options to pass to page
104
104
  */
105
105
  export interface ConversationListInstancePageOptions {
106
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
106
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
107
107
  startDate?: string;
108
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
108
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
109
109
  endDate?: string;
110
110
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
111
111
  state?: ConversationState;
@@ -69,9 +69,9 @@ export interface ConversationListInstanceCreateOptions {
69
69
  * Options to pass to each
70
70
  */
71
71
  export interface ConversationListInstanceEachOptions {
72
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
72
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
73
73
  startDate?: string;
74
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
74
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
75
75
  endDate?: string;
76
76
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
77
77
  state?: ConversationState;
@@ -88,9 +88,9 @@ export interface ConversationListInstanceEachOptions {
88
88
  * Options to pass to list
89
89
  */
90
90
  export interface ConversationListInstanceOptions {
91
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
91
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
92
92
  startDate?: string;
93
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
93
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
94
94
  endDate?: string;
95
95
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
96
96
  state?: ConversationState;
@@ -103,9 +103,9 @@ export interface ConversationListInstanceOptions {
103
103
  * Options to pass to page
104
104
  */
105
105
  export interface ConversationListInstancePageOptions {
106
- /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
106
+ /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
107
107
  startDate?: string;
108
- /** End date in ISO8601 format for sorting and filtering list of Conversations. */
108
+ /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
109
109
  endDate?: string;
110
110
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
111
111
  state?: ConversationState;
@@ -13,28 +13,24 @@ export interface AssessmentsContextUpdateOptions {
13
13
  answerText: string;
14
14
  /** The id of the answer selected by user */
15
15
  answerId: string;
16
- /** The Token HTTP request header */
17
- token?: string;
16
+ /** The Authorization HTTP request header */
17
+ authorization?: string;
18
18
  }
19
19
  /**
20
20
  * Options to pass to create a AssessmentsInstance
21
21
  */
22
22
  export interface AssessmentsListInstanceCreateOptions {
23
- /** The id of the category */
24
- categoryId: string;
23
+ /** The SID of the category */
24
+ categorySid: string;
25
25
  /** The name of the category */
26
26
  categoryName: string;
27
27
  /** Segment Id of the conversation */
28
28
  segmentId: string;
29
- /** Name of the user assessing conversation */
30
- userName: string;
31
- /** Email of the user assessing conversation */
32
- userEmail: string;
33
29
  /** The id of the Agent */
34
30
  agentId: string;
35
31
  /** The offset of the conversation. */
36
32
  offset: number;
37
- /** The question Id selected for assessment */
33
+ /** The question SID selected for assessment */
38
34
  metricId: string;
39
35
  /** The question name of the assessment */
40
36
  metricName: string;
@@ -42,17 +38,17 @@ export interface AssessmentsListInstanceCreateOptions {
42
38
  answerText: string;
43
39
  /** The id of the answer selected by user */
44
40
  answerId: string;
45
- /** Questionnaire Id of the associated question */
46
- questionnaireId: string;
47
- /** The Token HTTP request header */
48
- token?: string;
41
+ /** Questionnaire SID of the associated question */
42
+ questionnaireSid: string;
43
+ /** The Authorization HTTP request header */
44
+ authorization?: string;
49
45
  }
50
46
  /**
51
47
  * Options to pass to each
52
48
  */
53
49
  export interface AssessmentsListInstanceEachOptions {
54
- /** The Token HTTP request header */
55
- token?: string;
50
+ /** The Authorization HTTP request header */
51
+ authorization?: string;
56
52
  /** The id of the segment. */
57
53
  segmentId?: string;
58
54
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
@@ -68,8 +64,8 @@ export interface AssessmentsListInstanceEachOptions {
68
64
  * Options to pass to list
69
65
  */
70
66
  export interface AssessmentsListInstanceOptions {
71
- /** The Token HTTP request header */
72
- token?: string;
67
+ /** The Authorization HTTP request header */
68
+ authorization?: string;
73
69
  /** The id of the segment. */
74
70
  segmentId?: string;
75
71
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
@@ -81,8 +77,8 @@ export interface AssessmentsListInstanceOptions {
81
77
  * Options to pass to page
82
78
  */
83
79
  export interface AssessmentsListInstancePageOptions {
84
- /** The Token HTTP request header */
85
- token?: string;
80
+ /** The Authorization HTTP request header */
81
+ authorization?: string;
86
82
  /** The id of the segment. */
87
83
  segmentId?: string;
88
84
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
@@ -109,13 +105,13 @@ export interface AssessmentsContext {
109
105
  [inspect.custom](_depth: any, options: InspectOptions): any;
110
106
  }
111
107
  export interface AssessmentsContextSolution {
112
- assessmentId: string;
108
+ assessmentSid: string;
113
109
  }
114
110
  export declare class AssessmentsContextImpl implements AssessmentsContext {
115
111
  protected _version: V1;
116
112
  protected _solution: AssessmentsContextSolution;
117
113
  protected _uri: string;
118
- constructor(_version: V1, assessmentId: string);
114
+ constructor(_version: V1, assessmentSid: string);
119
115
  update(params: AssessmentsContextUpdateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise<AssessmentsInstance>;
120
116
  /**
121
117
  * Provide a user-friendly representation
@@ -130,7 +126,7 @@ interface AssessmentsPayload extends TwilioResponsePayload {
130
126
  }
131
127
  interface AssessmentsResource {
132
128
  account_sid: string;
133
- assessment_id: string;
129
+ assessment_sid: string;
134
130
  offset: number;
135
131
  report: boolean;
136
132
  weight: number;
@@ -148,15 +144,15 @@ export declare class AssessmentsInstance {
148
144
  protected _version: V1;
149
145
  protected _solution: AssessmentsContextSolution;
150
146
  protected _context?: AssessmentsContext;
151
- constructor(_version: V1, payload: AssessmentsResource, assessmentId?: string);
147
+ constructor(_version: V1, payload: AssessmentsResource, assessmentSid?: string);
152
148
  /**
153
149
  * The unique SID identifier of the Account.
154
150
  */
155
151
  accountSid: string;
156
152
  /**
157
- * The unique id of the assessment
153
+ * The SID of the assessment
158
154
  */
159
- assessmentId: string;
155
+ assessmentSid: string;
160
156
  /**
161
157
  * Offset of the conversation
162
158
  */
@@ -216,7 +212,7 @@ export declare class AssessmentsInstance {
216
212
  */
217
213
  toJSON(): {
218
214
  accountSid: string;
219
- assessmentId: string;
215
+ assessmentSid: string;
220
216
  offset: number;
221
217
  report: boolean;
222
218
  weight: number;
@@ -238,8 +234,8 @@ export interface AssessmentsListInstance {
238
234
  _version: V1;
239
235
  _solution: AssessmentsSolution;
240
236
  _uri: string;
241
- (assessmentId: string): AssessmentsContext;
242
- get(assessmentId: string): AssessmentsContext;
237
+ (assessmentSid: string): AssessmentsContext;
238
+ get(assessmentSid: string): AssessmentsContext;
243
239
  /**
244
240
  * Create a AssessmentsInstance
245
241
  *