@sentdm/sentdm 0.7.1 → 0.14.0
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/CHANGELOG.md +125 -0
- package/README.md +71 -34
- package/client.d.mts +49 -21
- package/client.d.mts.map +1 -1
- package/client.d.ts +49 -21
- package/client.d.ts.map +1 -1
- package/client.js +59 -38
- package/client.js.map +1 -1
- package/client.mjs +59 -38
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/contacts.d.mts +243 -49
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +243 -49
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +112 -15
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +112 -15
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +269 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +269 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +40 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +36 -0
- package/resources/me.mjs.map +1 -0
- package/resources/messages.d.mts +239 -133
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +239 -133
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +42 -50
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +42 -50
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +70 -0
- package/resources/numbers.d.mts.map +1 -0
- package/resources/numbers.d.ts +70 -0
- package/resources/numbers.d.ts.map +1 -0
- package/resources/numbers.js +36 -0
- package/resources/numbers.js.map +1 -0
- package/resources/numbers.mjs +32 -0
- package/resources/numbers.mjs.map +1 -0
- package/resources/profiles/campaigns.d.mts +339 -0
- package/resources/profiles/campaigns.d.mts.map +1 -0
- package/resources/profiles/campaigns.d.ts +339 -0
- package/resources/profiles/campaigns.d.ts.map +1 -0
- package/resources/profiles/campaigns.js +148 -0
- package/resources/profiles/campaigns.js.map +1 -0
- package/resources/profiles/campaigns.mjs +144 -0
- package/resources/profiles/campaigns.mjs.map +1 -0
- package/resources/profiles/index.d.mts +3 -0
- package/resources/profiles/index.d.mts.map +1 -0
- package/resources/profiles/index.d.ts +3 -0
- package/resources/profiles/index.d.ts.map +1 -0
- package/resources/profiles/index.js +9 -0
- package/resources/profiles/index.js.map +1 -0
- package/resources/profiles/index.mjs +4 -0
- package/resources/profiles/index.mjs.map +1 -0
- package/resources/profiles/profiles.d.mts +967 -0
- package/resources/profiles/profiles.d.mts.map +1 -0
- package/resources/profiles/profiles.d.ts +967 -0
- package/resources/profiles/profiles.d.ts.map +1 -0
- package/resources/profiles/profiles.js +227 -0
- package/resources/profiles/profiles.js.map +1 -0
- package/resources/profiles/profiles.mjs +222 -0
- package/resources/profiles/profiles.mjs.map +1 -0
- package/resources/profiles.d.mts +2 -0
- package/resources/profiles.d.mts.map +1 -0
- package/resources/profiles.d.ts +2 -0
- package/resources/profiles.d.ts.map +1 -0
- package/resources/profiles.js +6 -0
- package/resources/profiles.js.map +1 -0
- package/resources/profiles.mjs +3 -0
- package/resources/profiles.mjs.map +1 -0
- package/resources/templates.d.mts +327 -191
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +327 -191
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +80 -35
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +80 -35
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +251 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +251 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +124 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +120 -0
- package/resources/users.mjs.map +1 -0
- package/resources/webhooks.d.mts +639 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +639 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +237 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +233 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +235 -79
- package/src/internal/utils/log.ts +0 -1
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/contacts.ts +335 -57
- package/src/resources/index.ts +81 -12
- package/src/resources/me.ts +333 -0
- package/src/resources/messages.ts +306 -147
- package/src/resources/numbers.ts +102 -0
- package/src/resources/profiles/campaigns.ts +501 -0
- package/src/resources/profiles/index.ts +38 -0
- package/src/resources/profiles/profiles.ts +1302 -0
- package/src/resources/profiles.ts +3 -0
- package/src/resources/templates.ts +424 -202
- package/src/resources/users.ts +366 -0
- package/src/resources/webhooks.ts +923 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/number-lookup.d.mts +0 -59
- package/resources/number-lookup.d.mts.map +0 -1
- package/resources/number-lookup.d.ts +0 -59
- package/resources/number-lookup.d.ts.map +0 -1
- package/resources/number-lookup.js +0 -17
- package/resources/number-lookup.js.map +0 -1
- package/resources/number-lookup.mjs +0 -13
- package/resources/number-lookup.mjs.map +0 -1
- package/src/resources/number-lookup.ts +0 -80
|
@@ -1,283 +1,442 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as WebhooksAPI from './webhooks';
|
|
4
5
|
import { APIPromise } from '../core/api-promise';
|
|
5
6
|
import { buildHeaders } from '../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Send and track SMS and WhatsApp messages
|
|
12
|
+
*/
|
|
9
13
|
export class Messages extends APIResource {
|
|
10
14
|
/**
|
|
11
|
-
* Retrieves
|
|
12
|
-
*
|
|
13
|
-
* template details, contact information, and pricing. The customer ID is extracted
|
|
14
|
-
* from the authentication token to ensure the message belongs to the authenticated
|
|
15
|
-
* customer.
|
|
15
|
+
* Retrieves the activity log for a specific message. Activities track the message
|
|
16
|
+
* lifecycle including acceptance, processing, sending, delivery, and any errors.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```ts
|
|
19
|
-
* const
|
|
20
|
-
* '
|
|
20
|
+
* const response = await client.messages.retrieveActivities(
|
|
21
|
+
* '8ba7b830-9dad-11d1-80b4-00c04fd430c8',
|
|
21
22
|
* );
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* from the authentication token.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* await client.messages.sendQuickMessage({
|
|
36
|
-
* customMessage: 'Hello, this is a test message!',
|
|
37
|
-
* phoneNumber: '+1234567890',
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
sendQuickMessage(body: MessageSendQuickMessageParams, options?: RequestOptions): APIPromise<void> {
|
|
42
|
-
return this._client.post('/v2/messages/quick-message', {
|
|
43
|
-
body,
|
|
25
|
+
retrieveActivities(
|
|
26
|
+
id: string,
|
|
27
|
+
params: MessageRetrieveActivitiesParams | null | undefined = {},
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<MessageRetrieveActivitiesResponse> {
|
|
30
|
+
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
31
|
+
return this._client.get(path`/v3/messages/${id}/activities`, {
|
|
44
32
|
...options,
|
|
45
|
-
headers: buildHeaders([
|
|
33
|
+
headers: buildHeaders([
|
|
34
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
35
|
+
options?.headers,
|
|
36
|
+
]),
|
|
46
37
|
});
|
|
47
38
|
}
|
|
48
39
|
|
|
49
40
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* a webhook URL to receive delivery status updates. The customer ID is extracted
|
|
53
|
-
* from the authentication token.
|
|
41
|
+
* Retrieves the current status and details of a message by ID. Includes delivery
|
|
42
|
+
* status, timestamps, and error information if applicable.
|
|
54
43
|
*
|
|
55
44
|
* @example
|
|
56
45
|
* ```ts
|
|
57
|
-
* await client.messages.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* });
|
|
46
|
+
* const response = await client.messages.retrieveStatus(
|
|
47
|
+
* '8ba7b830-9dad-11d1-80b4-00c04fd430c8',
|
|
48
|
+
* );
|
|
61
49
|
* ```
|
|
62
50
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
retrieveStatus(
|
|
52
|
+
id: string,
|
|
53
|
+
params: MessageRetrieveStatusParams | null | undefined = {},
|
|
54
|
+
options?: RequestOptions,
|
|
55
|
+
): APIPromise<MessageRetrieveStatusResponse> {
|
|
56
|
+
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
57
|
+
return this._client.get(path`/v3/messages/${id}`, {
|
|
66
58
|
...options,
|
|
67
|
-
headers: buildHeaders([
|
|
59
|
+
headers: buildHeaders([
|
|
60
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
61
|
+
options?.headers,
|
|
62
|
+
]),
|
|
68
63
|
});
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
/**
|
|
72
|
-
* Sends a message to
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
67
|
+
* Sends a message to one or more recipients using a template. Supports
|
|
68
|
+
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
69
|
+
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
70
|
+
* Returns immediately with per-recipient message IDs for async tracking via
|
|
71
|
+
* webhooks or the GET /messages/{id} endpoint.
|
|
76
72
|
*
|
|
77
73
|
* @example
|
|
78
74
|
* ```ts
|
|
79
|
-
* await client.messages.
|
|
80
|
-
* phoneNumber: '+1234567890',
|
|
81
|
-
* templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
82
|
-
* });
|
|
75
|
+
* const response = await client.messages.send();
|
|
83
76
|
* ```
|
|
84
77
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
send(params: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse> {
|
|
79
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
80
|
+
return this._client.post('/v3/messages', {
|
|
87
81
|
body,
|
|
88
82
|
...options,
|
|
89
|
-
headers: buildHeaders([
|
|
83
|
+
headers: buildHeaders([
|
|
84
|
+
{
|
|
85
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
86
|
+
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
87
|
+
},
|
|
88
|
+
options?.headers,
|
|
89
|
+
]),
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
96
|
-
* (v2)
|
|
95
|
+
* Standard API response envelope for all v3 endpoints
|
|
97
96
|
*/
|
|
98
|
-
export interface
|
|
97
|
+
export interface MessageRetrieveActivitiesResponse {
|
|
99
98
|
/**
|
|
100
|
-
*
|
|
99
|
+
* Response for GET /messages/{id}/activities
|
|
101
100
|
*/
|
|
102
|
-
|
|
101
|
+
data?: MessageRetrieveActivitiesResponse.Data | null;
|
|
103
102
|
|
|
104
103
|
/**
|
|
105
|
-
*
|
|
104
|
+
* Error information
|
|
106
105
|
*/
|
|
107
|
-
|
|
106
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
108
107
|
|
|
109
108
|
/**
|
|
110
|
-
*
|
|
109
|
+
* Request and response metadata
|
|
111
110
|
*/
|
|
112
|
-
|
|
111
|
+
meta?: WebhooksAPI.APIMeta;
|
|
113
112
|
|
|
114
113
|
/**
|
|
115
|
-
*
|
|
114
|
+
* Indicates whether the request was successful
|
|
116
115
|
*/
|
|
117
|
-
|
|
116
|
+
success?: boolean;
|
|
117
|
+
}
|
|
118
118
|
|
|
119
|
+
export namespace MessageRetrieveActivitiesResponse {
|
|
119
120
|
/**
|
|
120
|
-
*
|
|
121
|
+
* Response for GET /messages/{id}/activities
|
|
121
122
|
*/
|
|
122
|
-
|
|
123
|
+
export interface Data {
|
|
124
|
+
/**
|
|
125
|
+
* List of activity events ordered by most recent first
|
|
126
|
+
*/
|
|
127
|
+
activities?: Array<Data.Activity>;
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
/**
|
|
130
|
+
* The message ID these activities belong to
|
|
131
|
+
*/
|
|
132
|
+
message_id?: string;
|
|
133
|
+
}
|
|
128
134
|
|
|
135
|
+
export namespace Data {
|
|
136
|
+
/**
|
|
137
|
+
* A single message activity event for v3 API
|
|
138
|
+
*/
|
|
139
|
+
export interface Activity {
|
|
140
|
+
/**
|
|
141
|
+
* Active contact markup applied on top of the channel cost, formatted to 4 decimal
|
|
142
|
+
* places.
|
|
143
|
+
*/
|
|
144
|
+
active_contact_price?: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Human-readable description of the activity
|
|
148
|
+
*/
|
|
149
|
+
description?: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Channel cost for this activity (e.g., SMS/WhatsApp provider cost), formatted to
|
|
153
|
+
* 4 decimal places.
|
|
154
|
+
*/
|
|
155
|
+
price?: string | null;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Activity status (e.g., ACCEPTED, PROCESSED, SENT, DELIVERED, FAILED)
|
|
159
|
+
*/
|
|
160
|
+
status?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* When this activity occurred
|
|
164
|
+
*/
|
|
165
|
+
timestamp?: string;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Standard API response envelope for all v3 endpoints
|
|
172
|
+
*/
|
|
173
|
+
export interface MessageRetrieveStatusResponse {
|
|
129
174
|
/**
|
|
130
|
-
*
|
|
131
|
-
* includes a status and timestamp, following industry standards (Twilio, SendGrid,
|
|
132
|
-
* Mailgun). Events are ordered chronologically from oldest to newest.
|
|
175
|
+
* Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
133
176
|
*/
|
|
134
|
-
|
|
177
|
+
data?: MessageRetrieveStatusResponse.Data | null;
|
|
135
178
|
|
|
136
179
|
/**
|
|
137
|
-
*
|
|
180
|
+
* Error information
|
|
138
181
|
*/
|
|
139
|
-
|
|
182
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
140
183
|
|
|
141
184
|
/**
|
|
142
|
-
*
|
|
185
|
+
* Request and response metadata
|
|
143
186
|
*/
|
|
144
|
-
|
|
187
|
+
meta?: WebhooksAPI.APIMeta;
|
|
145
188
|
|
|
146
189
|
/**
|
|
147
|
-
*
|
|
190
|
+
* Indicates whether the request was successful
|
|
148
191
|
*/
|
|
149
|
-
|
|
192
|
+
success?: boolean;
|
|
193
|
+
}
|
|
150
194
|
|
|
195
|
+
export namespace MessageRetrieveStatusResponse {
|
|
151
196
|
/**
|
|
152
|
-
*
|
|
197
|
+
* Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
153
198
|
*/
|
|
154
|
-
|
|
199
|
+
export interface Data {
|
|
200
|
+
id?: string;
|
|
201
|
+
|
|
202
|
+
active_contact_price?: number | null;
|
|
203
|
+
|
|
204
|
+
channel?: string;
|
|
205
|
+
|
|
206
|
+
contact_id?: string;
|
|
207
|
+
|
|
208
|
+
created_at?: string;
|
|
209
|
+
|
|
210
|
+
customer_id?: string;
|
|
211
|
+
|
|
212
|
+
events?: Array<Data.Event> | null;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Structured message body format for database storage. Preserves channel-specific
|
|
216
|
+
* components (header, body, footer, buttons).
|
|
217
|
+
*/
|
|
218
|
+
message_body?: Data.MessageBody | null;
|
|
219
|
+
|
|
220
|
+
phone?: string;
|
|
221
|
+
|
|
222
|
+
phone_international?: string;
|
|
223
|
+
|
|
224
|
+
price?: number | null;
|
|
225
|
+
|
|
226
|
+
region_code?: string;
|
|
227
|
+
|
|
228
|
+
status?: string;
|
|
229
|
+
|
|
230
|
+
template_category?: string;
|
|
231
|
+
|
|
232
|
+
template_id?: string | null;
|
|
233
|
+
|
|
234
|
+
template_name?: string;
|
|
235
|
+
}
|
|
155
236
|
|
|
237
|
+
export namespace Data {
|
|
238
|
+
/**
|
|
239
|
+
* Represents a status change event in a message's lifecycle (v3)
|
|
240
|
+
*/
|
|
241
|
+
export interface Event {
|
|
242
|
+
description?: string | null;
|
|
243
|
+
|
|
244
|
+
status?: string;
|
|
245
|
+
|
|
246
|
+
timestamp?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Structured message body format for database storage. Preserves channel-specific
|
|
251
|
+
* components (header, body, footer, buttons).
|
|
252
|
+
*/
|
|
253
|
+
export interface MessageBody {
|
|
254
|
+
buttons?: Array<MessageBody.Button> | null;
|
|
255
|
+
|
|
256
|
+
content?: string;
|
|
257
|
+
|
|
258
|
+
footer?: string | null;
|
|
259
|
+
|
|
260
|
+
header?: string | null;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export namespace MessageBody {
|
|
264
|
+
export interface Button {
|
|
265
|
+
type?: string;
|
|
266
|
+
|
|
267
|
+
value?: string;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Standard API response envelope for all v3 endpoints
|
|
275
|
+
*/
|
|
276
|
+
export interface MessageSendResponse {
|
|
156
277
|
/**
|
|
157
|
-
*
|
|
278
|
+
* Response for the multi-recipient send message endpoint
|
|
158
279
|
*/
|
|
159
|
-
|
|
280
|
+
data?: MessageSendResponse.Data | null;
|
|
160
281
|
|
|
161
282
|
/**
|
|
162
|
-
*
|
|
283
|
+
* Error information
|
|
163
284
|
*/
|
|
164
|
-
|
|
285
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
165
286
|
|
|
166
287
|
/**
|
|
167
|
-
*
|
|
168
|
-
* was used)
|
|
288
|
+
* Request and response metadata
|
|
169
289
|
*/
|
|
170
|
-
|
|
290
|
+
meta?: WebhooksAPI.APIMeta;
|
|
171
291
|
|
|
172
292
|
/**
|
|
173
|
-
*
|
|
293
|
+
* Indicates whether the request was successful
|
|
174
294
|
*/
|
|
175
|
-
|
|
295
|
+
success?: boolean;
|
|
176
296
|
}
|
|
177
297
|
|
|
178
|
-
export namespace
|
|
298
|
+
export namespace MessageSendResponse {
|
|
179
299
|
/**
|
|
180
|
-
*
|
|
181
|
-
* standards (Twilio, SendGrid, Mailgun pattern)
|
|
300
|
+
* Response for the multi-recipient send message endpoint
|
|
182
301
|
*/
|
|
183
|
-
export interface
|
|
302
|
+
export interface Data {
|
|
184
303
|
/**
|
|
185
|
-
*
|
|
186
|
-
* additional context
|
|
304
|
+
* Resolved template body text
|
|
187
305
|
*/
|
|
188
|
-
|
|
306
|
+
body?: string | null;
|
|
189
307
|
|
|
190
308
|
/**
|
|
191
|
-
*
|
|
192
|
-
* "delivered", "read", "failed"
|
|
309
|
+
* Per-recipient message results
|
|
193
310
|
*/
|
|
194
|
-
|
|
311
|
+
recipients?: Array<Data.Recipient>;
|
|
195
312
|
|
|
196
313
|
/**
|
|
197
|
-
*
|
|
314
|
+
* Overall request status (e.g. "accepted")
|
|
198
315
|
*/
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* The message body content with variables substituted
|
|
204
|
-
*/
|
|
205
|
-
export interface MessageBody {
|
|
206
|
-
buttons?: Array<MessageBody.Button> | null;
|
|
207
|
-
|
|
208
|
-
content?: string;
|
|
316
|
+
status?: string;
|
|
209
317
|
|
|
210
|
-
|
|
318
|
+
/**
|
|
319
|
+
* Template ID that was used
|
|
320
|
+
*/
|
|
321
|
+
template_id?: string;
|
|
211
322
|
|
|
212
|
-
|
|
323
|
+
/**
|
|
324
|
+
* Template display name
|
|
325
|
+
*/
|
|
326
|
+
template_name?: string;
|
|
213
327
|
}
|
|
214
328
|
|
|
215
|
-
export namespace
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
329
|
+
export namespace Data {
|
|
330
|
+
/**
|
|
331
|
+
* Per-recipient result in the send message response
|
|
332
|
+
*/
|
|
333
|
+
export interface Recipient {
|
|
334
|
+
/**
|
|
335
|
+
* Channel this message will be sent on (e.g. "sms", "whatsapp"), or null for
|
|
336
|
+
* auto-detect
|
|
337
|
+
*/
|
|
338
|
+
channel?: string | null;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Unique message identifier for tracking this recipient's message
|
|
342
|
+
*/
|
|
343
|
+
message_id?: string;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Phone number in E.164 format
|
|
347
|
+
*/
|
|
348
|
+
to?: string;
|
|
220
349
|
}
|
|
221
350
|
}
|
|
222
351
|
}
|
|
223
352
|
|
|
224
|
-
export interface
|
|
353
|
+
export interface MessageRetrieveActivitiesParams {
|
|
225
354
|
/**
|
|
226
|
-
*
|
|
355
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
356
|
+
* can use this header. The profile must belong to the calling organization.
|
|
227
357
|
*/
|
|
228
|
-
|
|
358
|
+
'x-profile-id'?: string;
|
|
359
|
+
}
|
|
229
360
|
|
|
361
|
+
export interface MessageRetrieveStatusParams {
|
|
230
362
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
363
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
364
|
+
* can use this header. The profile must belong to the calling organization.
|
|
233
365
|
*/
|
|
234
|
-
|
|
366
|
+
'x-profile-id'?: string;
|
|
235
367
|
}
|
|
236
368
|
|
|
237
|
-
export interface
|
|
369
|
+
export interface MessageSendParams {
|
|
238
370
|
/**
|
|
239
|
-
*
|
|
371
|
+
* Body param: Channels to broadcast on, e.g. ["whatsapp", "sms"]. Each channel
|
|
372
|
+
* produces a separate message per recipient. "sent" = auto-detect, "rcs" =
|
|
373
|
+
* reserved (skipped). Defaults to ["sent"] (auto-detect) if omitted.
|
|
240
374
|
*/
|
|
241
|
-
|
|
375
|
+
channel?: Array<string> | null;
|
|
242
376
|
|
|
243
377
|
/**
|
|
244
|
-
*
|
|
378
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
379
|
+
* effects Useful for testing integrations without actual execution
|
|
245
380
|
*/
|
|
246
|
-
|
|
381
|
+
sandbox?: boolean;
|
|
247
382
|
|
|
248
383
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* "name": "John Doe" }
|
|
384
|
+
* Body param: SDK-style template reference: resolve by ID or by name, with
|
|
385
|
+
* optional parameters.
|
|
252
386
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
387
|
+
template?: MessageSendParams.Template;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Body param: List of recipient phone numbers in E.164 format (multi-recipient
|
|
391
|
+
* fan-out)
|
|
392
|
+
*/
|
|
393
|
+
to?: Array<string>;
|
|
255
394
|
|
|
256
|
-
export interface MessageSendToPhoneParams {
|
|
257
395
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
396
|
+
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
397
|
+
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
398
|
+
* hours per key per customer.
|
|
260
399
|
*/
|
|
261
|
-
|
|
400
|
+
'Idempotency-Key'?: string;
|
|
262
401
|
|
|
263
402
|
/**
|
|
264
|
-
*
|
|
403
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
404
|
+
* organization API keys can use this header. The profile must belong to the
|
|
405
|
+
* calling organization.
|
|
265
406
|
*/
|
|
266
|
-
|
|
407
|
+
'x-profile-id'?: string;
|
|
408
|
+
}
|
|
267
409
|
|
|
410
|
+
export namespace MessageSendParams {
|
|
268
411
|
/**
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
* "name": "John Doe" }
|
|
412
|
+
* SDK-style template reference: resolve by ID or by name, with optional
|
|
413
|
+
* parameters.
|
|
272
414
|
*/
|
|
273
|
-
|
|
415
|
+
export interface Template {
|
|
416
|
+
/**
|
|
417
|
+
* Template ID (mutually exclusive with name)
|
|
418
|
+
*/
|
|
419
|
+
id?: string | null;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Template name (mutually exclusive with id)
|
|
423
|
+
*/
|
|
424
|
+
name?: string | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Template variable parameters for personalization
|
|
428
|
+
*/
|
|
429
|
+
parameters?: { [key: string]: string } | null;
|
|
430
|
+
}
|
|
274
431
|
}
|
|
275
432
|
|
|
276
433
|
export declare namespace Messages {
|
|
277
434
|
export {
|
|
278
|
-
type
|
|
279
|
-
type
|
|
280
|
-
type
|
|
281
|
-
type
|
|
435
|
+
type MessageRetrieveActivitiesResponse as MessageRetrieveActivitiesResponse,
|
|
436
|
+
type MessageRetrieveStatusResponse as MessageRetrieveStatusResponse,
|
|
437
|
+
type MessageSendResponse as MessageSendResponse,
|
|
438
|
+
type MessageRetrieveActivitiesParams as MessageRetrieveActivitiesParams,
|
|
439
|
+
type MessageRetrieveStatusParams as MessageRetrieveStatusParams,
|
|
440
|
+
type MessageSendParams as MessageSendParams,
|
|
282
441
|
};
|
|
283
442
|
}
|