@signalhousellc/sdk 1.0.56 → 1.0.62
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.
- package/package.json +1 -1
- package/src/SignalHouseSDK.js +1 -1
- package/src/domains/Auth.js +4 -2
- package/src/domains/Brands.js +275 -206
- package/src/domains/Campaigns.js +417 -226
- package/src/domains/Messages.js +37 -1
- package/src/domains/Numbers.js +457 -378
- package/src/domains/Voice.js +13 -4
- package/src/domains/voice/CallLogs.js +105 -0
- package/src/domains/voice/GlobalVoiceSettings.js +48 -0
- package/src/domains/voice/ProgrammableVoiceProfiles.js +181 -0
- package/src/domains/voice/SipTrunks.js +37 -0
package/src/domains/Messages.js
CHANGED
|
@@ -247,6 +247,16 @@ export class Messages {
|
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
249
|
* Send an SMS message to one or more recipient phone numbers
|
|
250
|
+
*
|
|
251
|
+
* The response reports the send outcome with three fields so callers do not have to inspect
|
|
252
|
+
* insertedMessages: requestedRecipientCount, enqueuedCount, and failedCount. enqueuedCount is the
|
|
253
|
+
* number of recipients accepted for delivery and is 0 when the send was fully blocked (by the
|
|
254
|
+
* moderation filter or a campaign opt-out); the request still resolves successfully in that case, so
|
|
255
|
+
* treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Blocked
|
|
256
|
+
* recipients are returned in insertedMessages with status "FAILED"; recipients on the global Do Not
|
|
257
|
+
* Contact list are reported in dncBlockedNumbers with no message record. Each FAILED message carries
|
|
258
|
+
* errorCode, a stable machine-readable cause (campaign opt-out is "OUT"; null on success or on
|
|
259
|
+
* failures with no assigned code) that is also included on the FAILED status-callback payload.
|
|
250
260
|
* @async
|
|
251
261
|
* @roles api, admin, developer, billing, user
|
|
252
262
|
* @param {Object} params - The parameters for sending an SMS message
|
|
@@ -276,16 +286,22 @@ export class Messages {
|
|
|
276
286
|
* @param {string[]} params.recipientPhoneNumbers - The phone number(s) to send the message to
|
|
277
287
|
* @param {string} params.messageBody - The body of the P2P message
|
|
278
288
|
* @param {string} [params.statusCallbackUrl] - The URL to receive status callbacks
|
|
289
|
+
* @param {string} [params.groupId] - Explicit group to send from. Defaults to the group in your auth context.
|
|
290
|
+
* @param {string} [params.subgroupId] - Explicit subgroup to attribute the send (and its inbound reply) to.
|
|
291
|
+
* P2P has no dedicated sender number, so pass this to record the send against a specific subgroup; it also
|
|
292
|
+
* resolves the group. Defaults to the group's oldest subgroup.
|
|
279
293
|
* @param {boolean} [params.useSignalHouseShortlinks] - When false, SignalHouse applies no link-shortening
|
|
280
294
|
* or text-spin and your pre-spun links/content are sent verbatim (bring-your-own spinner). Defaults to
|
|
281
295
|
* true server-side (the SignalHouse shortlink system, which mints unique per-recipient links).
|
|
282
296
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
283
297
|
* @returns {Promise<Object>} - A promise that resolves to the response data from the server
|
|
284
298
|
*/
|
|
285
|
-
async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, useSignalHouseShortlinks, options = {} }) {
|
|
299
|
+
async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, groupId, subgroupId, useSignalHouseShortlinks, options = {} }) {
|
|
286
300
|
this.client._require({ recipientPhoneNumbers, messageBody });
|
|
287
301
|
const body = { recipientPhoneNumber: recipientPhoneNumbers, messageBody };
|
|
288
302
|
if (statusCallbackUrl) body.statusCallbackUrl = statusCallbackUrl;
|
|
303
|
+
if (groupId) body.groupId = groupId;
|
|
304
|
+
if (subgroupId) body.subgroupId = subgroupId;
|
|
289
305
|
if (typeof useSignalHouseShortlinks === "boolean") body.useSignalHouseShortlinks = useSignalHouseShortlinks;
|
|
290
306
|
return this.client(`/message/p2p`, {
|
|
291
307
|
method: "POST",
|
|
@@ -312,6 +328,16 @@ export class Messages {
|
|
|
312
328
|
|
|
313
329
|
/**
|
|
314
330
|
* Send an MMS message to one or more recipient phone numbers, with optional media attachments and status callback
|
|
331
|
+
*
|
|
332
|
+
* The response reports the send outcome with three fields so callers do not have to inspect
|
|
333
|
+
* insertedMessages: requestedRecipientCount, enqueuedCount, and failedCount. enqueuedCount is the
|
|
334
|
+
* number of recipients accepted for delivery and is 0 when the send was fully blocked (by the
|
|
335
|
+
* moderation filter or a campaign opt-out); the request still resolves successfully in that case, so
|
|
336
|
+
* treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Blocked
|
|
337
|
+
* recipients are returned in insertedMessages with status "FAILED"; recipients on the global Do Not
|
|
338
|
+
* Contact list are reported in dncBlockedNumbers with no message record. Each FAILED message carries
|
|
339
|
+
* errorCode, a stable machine-readable cause (campaign opt-out is "OUT"; null on success or on
|
|
340
|
+
* failures with no assigned code) that is also included on the FAILED status-callback payload.
|
|
315
341
|
* @async
|
|
316
342
|
* @roles api, admin, developer, billing, user
|
|
317
343
|
* @param {Object} params - The parameters for sending an MMS message
|
|
@@ -371,6 +397,16 @@ export class Messages {
|
|
|
371
397
|
|
|
372
398
|
/**
|
|
373
399
|
* Send a group MMS message to one or more recipient phone numbers, with optional media attachments and status callback
|
|
400
|
+
*
|
|
401
|
+
* The response reports the send outcome with three fields so callers do not have to inspect
|
|
402
|
+
* insertedMessages: requestedRecipientCount, enqueuedCount, and failedCount. enqueuedCount is the
|
|
403
|
+
* number of recipients accepted for delivery and is 0 when the send was fully blocked (by the
|
|
404
|
+
* moderation filter or a campaign opt-out); the request still resolves successfully in that case, so
|
|
405
|
+
* treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Blocked
|
|
406
|
+
* recipients are returned in insertedMessages with status "FAILED"; recipients on the global Do Not
|
|
407
|
+
* Contact list are reported in dncBlockedNumbers with no message record. Each FAILED message carries
|
|
408
|
+
* errorCode, a stable machine-readable cause (campaign opt-out is "OUT"; null on success or on
|
|
409
|
+
* failures with no assigned code) that is also included on the FAILED status-callback payload.
|
|
374
410
|
* @async
|
|
375
411
|
* @roles api, admin, developer, billing, user
|
|
376
412
|
* @param {Object} params - The parameters for sending an MMS message
|