@oficialapi/sdk 4.0.0 → 6.0.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/README.md +143 -59
- package/dist/index.d.mts +116 -40
- package/dist/index.d.ts +116 -40
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,14 @@ const accessToken = tokenResponse.access_token;
|
|
|
39
39
|
|
|
40
40
|
### WhatsApp
|
|
41
41
|
|
|
42
|
+
> **⚠️ Nota Importante:** Alguns métodos requerem upload prévio da mídia para obter o `mediaId` antes de enviar. Isso se aplica a:
|
|
43
|
+
> - `sendAudio` - Use `uploadMedia` primeiro para obter o `mediaId`
|
|
44
|
+
> - `sendVideo` - Use `uploadMedia` primeiro para obter o `mediaId`
|
|
45
|
+
> - `sendDocument` - Use `uploadMedia` primeiro para obter o `mediaId`
|
|
46
|
+
> - `sendSticker` - Use `uploadMedia` primeiro para obter o `mediaId`
|
|
47
|
+
>
|
|
48
|
+
> O método `sendMedia` ainda aceita `fileUrl` diretamente para imagens e outros tipos de mídia.
|
|
49
|
+
|
|
42
50
|
#### Enviar Mensagem de Texto
|
|
43
51
|
|
|
44
52
|
```typescript
|
|
@@ -88,23 +96,22 @@ await sdk.whatsapp.sendTemplate({
|
|
|
88
96
|
await sdk.whatsapp.sendButtons({
|
|
89
97
|
token: 'sk_live_...',
|
|
90
98
|
sender: '5511999999999',
|
|
91
|
-
|
|
99
|
+
text: 'Escolha uma opção:',
|
|
92
100
|
buttons: [
|
|
93
101
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
id: 'option1',
|
|
97
|
-
title: 'Opção 1'
|
|
98
|
-
}
|
|
102
|
+
id: 'option1',
|
|
103
|
+
title: 'Opção 1'
|
|
99
104
|
},
|
|
100
105
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
id: 'option2',
|
|
104
|
-
title: 'Opção 2'
|
|
105
|
-
}
|
|
106
|
+
id: 'option2',
|
|
107
|
+
title: 'Opção 2'
|
|
106
108
|
}
|
|
107
|
-
]
|
|
109
|
+
],
|
|
110
|
+
// Opcional: incluir mídia (imagem) no topo da mensagem
|
|
111
|
+
media: {
|
|
112
|
+
type: 'image',
|
|
113
|
+
url: 'https://example.com/image.jpg'
|
|
114
|
+
}
|
|
108
115
|
}, accessToken);
|
|
109
116
|
```
|
|
110
117
|
|
|
@@ -114,7 +121,9 @@ await sdk.whatsapp.sendButtons({
|
|
|
114
121
|
await sdk.whatsapp.sendList({
|
|
115
122
|
token: 'sk_live_...',
|
|
116
123
|
sender: '5511999999999',
|
|
117
|
-
|
|
124
|
+
headerText: 'Escolha um produto:',
|
|
125
|
+
bodyText: 'Selecione uma opção abaixo:',
|
|
126
|
+
footerText: 'Equipe de Vendas', // Opcional
|
|
118
127
|
buttonText: 'Ver Produtos',
|
|
119
128
|
sections: [
|
|
120
129
|
{
|
|
@@ -177,33 +186,45 @@ await sdk.whatsapp.sendLocation({
|
|
|
177
186
|
#### Enviar Áudio
|
|
178
187
|
|
|
179
188
|
```typescript
|
|
189
|
+
// Áudio básico (requer upload prévio da mídia)
|
|
180
190
|
await sdk.whatsapp.sendAudio({
|
|
181
191
|
token: 'sk_live_...',
|
|
182
192
|
sender: '5511999999999',
|
|
183
|
-
|
|
193
|
+
mediaId: '1013859600285441', // ID da mídia após upload
|
|
194
|
+
voice: false // Opcional: false para áudio básico
|
|
195
|
+
}, accessToken);
|
|
196
|
+
|
|
197
|
+
// Mensagem de voz (arquivo .ogg codec OPUS)
|
|
198
|
+
await sdk.whatsapp.sendAudio({
|
|
199
|
+
token: 'sk_live_...',
|
|
200
|
+
sender: '5511999999999',
|
|
201
|
+
mediaId: '1013859600285441',
|
|
202
|
+
voice: true // true para mensagem de voz
|
|
184
203
|
}, accessToken);
|
|
185
204
|
```
|
|
186
205
|
|
|
187
206
|
#### Enviar Vídeo
|
|
188
207
|
|
|
189
208
|
```typescript
|
|
209
|
+
// Requer upload prévio da mídia para obter o mediaId
|
|
190
210
|
await sdk.whatsapp.sendVideo({
|
|
191
211
|
token: 'sk_live_...',
|
|
192
212
|
sender: '5511999999999',
|
|
193
|
-
|
|
194
|
-
caption: 'Veja este vídeo!'
|
|
213
|
+
mediaId: '1166846181421424', // ID da mídia após upload
|
|
214
|
+
caption: 'Veja este vídeo!' // Opcional
|
|
195
215
|
}, accessToken);
|
|
196
216
|
```
|
|
197
217
|
|
|
198
218
|
#### Enviar Documento
|
|
199
219
|
|
|
200
220
|
```typescript
|
|
221
|
+
// Requer upload prévio da mídia para obter o mediaId
|
|
201
222
|
await sdk.whatsapp.sendDocument({
|
|
202
223
|
token: 'sk_live_...',
|
|
203
224
|
sender: '5511999999999',
|
|
204
|
-
|
|
205
|
-
filename: 'documento.pdf',
|
|
206
|
-
caption: 'Aqui está o documento'
|
|
225
|
+
mediaId: '1376223850470843', // ID da mídia após upload
|
|
226
|
+
filename: 'documento.pdf', // Opcional
|
|
227
|
+
caption: 'Aqui está o documento' // Opcional
|
|
207
228
|
}, accessToken);
|
|
208
229
|
```
|
|
209
230
|
|
|
@@ -213,25 +234,66 @@ await sdk.whatsapp.sendDocument({
|
|
|
213
234
|
await sdk.whatsapp.sendOrderDetails({
|
|
214
235
|
token: 'sk_live_...',
|
|
215
236
|
sender: '5511999999999',
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
quantity: 2,
|
|
222
|
-
price: 50.00
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
orderTotal: 100.00,
|
|
237
|
+
headerText: 'Confirmação de Pedido', // Opcional
|
|
238
|
+
bodyText: 'Seu pedido #12345 está pronto para pagamento!',
|
|
239
|
+
footerText: 'Obrigado por comprar conosco!', // Opcional
|
|
240
|
+
reference_id: 'pedido_12345_1704067200', // ID único do pedido
|
|
241
|
+
type: 'digital-goods', // ou 'physical-goods'
|
|
226
242
|
currency: 'BRL',
|
|
227
|
-
|
|
243
|
+
total_amount: {
|
|
244
|
+
value: 50000, // Valor em centavos (500.00)
|
|
245
|
+
offset: 100, // Fator de ajuste (sempre 100 para BRL)
|
|
246
|
+
description: 'Total do pedido' // Opcional
|
|
247
|
+
},
|
|
248
|
+
order: {
|
|
249
|
+
status: 'pending',
|
|
250
|
+
items: [
|
|
251
|
+
{
|
|
252
|
+
retailer_id: '1234567',
|
|
253
|
+
name: 'Produto 1',
|
|
254
|
+
amount: {
|
|
255
|
+
value: 50000,
|
|
256
|
+
offset: 100
|
|
257
|
+
},
|
|
258
|
+
quantity: 2
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
subtotal: {
|
|
262
|
+
value: 50000,
|
|
263
|
+
offset: 100
|
|
264
|
+
},
|
|
265
|
+
tax: {
|
|
266
|
+
value: 0,
|
|
267
|
+
offset: 100,
|
|
268
|
+
description: 'Sem impostos'
|
|
269
|
+
},
|
|
270
|
+
shipping: { // Opcional
|
|
271
|
+
value: 1000,
|
|
272
|
+
offset: 100,
|
|
273
|
+
description: 'Frete'
|
|
274
|
+
},
|
|
275
|
+
discount: { // Opcional
|
|
276
|
+
value: 5000,
|
|
277
|
+
offset: 100,
|
|
278
|
+
description: 'Desconto',
|
|
279
|
+
discount_program_name: 'Promoção'
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
payment_settings: [ // Opcional, máximo 2 métodos
|
|
228
283
|
{
|
|
229
|
-
type: '
|
|
230
|
-
|
|
284
|
+
type: 'pix_dynamic_code',
|
|
285
|
+
pix_dynamic_code: {
|
|
286
|
+
code: '00020101021226700014br.gov.bcb.pix2548pix.example.com...',
|
|
287
|
+
merchant_name: 'Minha Empresa Ltda',
|
|
288
|
+
key: '39580525000189',
|
|
289
|
+
key_type: 'CNPJ' // CPF, CNPJ, EMAIL, PHONE ou EVP
|
|
290
|
+
}
|
|
231
291
|
},
|
|
232
292
|
{
|
|
233
|
-
type: '
|
|
234
|
-
|
|
293
|
+
type: 'payment_link',
|
|
294
|
+
payment_link: {
|
|
295
|
+
uri: 'https://pagamento.exemplo.com/pedido/123'
|
|
296
|
+
}
|
|
235
297
|
}
|
|
236
298
|
]
|
|
237
299
|
}, accessToken);
|
|
@@ -243,19 +305,24 @@ await sdk.whatsapp.sendOrderDetails({
|
|
|
243
305
|
await sdk.whatsapp.sendOrderStatus({
|
|
244
306
|
token: 'sk_live_...',
|
|
245
307
|
sender: '5511999999999',
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
308
|
+
bodyText: 'Seu pedido foi enviado!',
|
|
309
|
+
footerText: 'Obrigado!', // Opcional
|
|
310
|
+
reference_id: 'pedido_12345_1704067200', // Mesmo ID usado em sendOrderDetails
|
|
311
|
+
order_status: 'shipped', // pending, processing, partially-shipped, shipped, completed, canceled
|
|
312
|
+
status_description: 'Sua encomenda foi despachada pelos Correios', // Opcional
|
|
313
|
+
payment_status: 'captured', // Opcional: pending, captured, failed
|
|
314
|
+
payment_timestamp: 1722445231 // Opcional: timestamp do pagamento em segundos
|
|
249
315
|
}, accessToken);
|
|
250
316
|
```
|
|
251
317
|
|
|
252
318
|
#### Enviar Sticker
|
|
253
319
|
|
|
254
320
|
```typescript
|
|
321
|
+
// Requer upload prévio da mídia para obter o mediaId
|
|
255
322
|
await sdk.whatsapp.sendSticker({
|
|
256
323
|
token: 'sk_live_...',
|
|
257
324
|
sender: '5511999999999',
|
|
258
|
-
|
|
325
|
+
mediaId: '798882015472548' // ID da mídia após upload (.webp até 500KB para animado, 100KB para estático)
|
|
259
326
|
}, accessToken);
|
|
260
327
|
```
|
|
261
328
|
|
|
@@ -265,7 +332,9 @@ await sdk.whatsapp.sendSticker({
|
|
|
265
332
|
await sdk.whatsapp.sendLocationRequest({
|
|
266
333
|
token: 'sk_live_...',
|
|
267
334
|
sender: '5511999999999',
|
|
268
|
-
|
|
335
|
+
bodyText: 'Por favor, compartilhe sua localização para entregarmos seu pedido.',
|
|
336
|
+
headerText: 'Confirme sua entrega', // Opcional (máximo 60 caracteres)
|
|
337
|
+
footerText: 'Sua privacidade é importante' // Opcional (máximo 60 caracteres)
|
|
269
338
|
}, accessToken);
|
|
270
339
|
```
|
|
271
340
|
|
|
@@ -275,9 +344,15 @@ await sdk.whatsapp.sendLocationRequest({
|
|
|
275
344
|
await sdk.whatsapp.sendCtaUrl({
|
|
276
345
|
token: 'sk_live_...',
|
|
277
346
|
sender: '5511999999999',
|
|
278
|
-
|
|
279
|
-
buttonText: 'Acessar',
|
|
280
|
-
url: 'https://example.com'
|
|
347
|
+
bodyText: 'Confira nosso site!',
|
|
348
|
+
buttonText: 'Acessar', // Máximo 20 caracteres
|
|
349
|
+
url: 'https://example.com',
|
|
350
|
+
header: { // Opcional: cabeçalho com mídia
|
|
351
|
+
type: 'image', // ou 'video', 'document', 'text'
|
|
352
|
+
link: 'https://example.com/banner.jpg' // Para image/video/document
|
|
353
|
+
// ou text: 'Título' para tipo text
|
|
354
|
+
},
|
|
355
|
+
footerText: 'Ofertas válidas até 30/11' // Opcional (máximo 60 caracteres)
|
|
281
356
|
}, accessToken);
|
|
282
357
|
```
|
|
283
358
|
|
|
@@ -287,20 +362,23 @@ await sdk.whatsapp.sendCtaUrl({
|
|
|
287
362
|
await sdk.whatsapp.sendMediaCarousel({
|
|
288
363
|
token: 'sk_live_...',
|
|
289
364
|
sender: '5511999999999',
|
|
290
|
-
|
|
365
|
+
bodyText: 'Confira nossas ofertas da semana!', // Obrigatório
|
|
366
|
+
cards: [ // 2 a 10 cartões
|
|
291
367
|
{
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
368
|
+
cardIndex: 0,
|
|
369
|
+
headerType: 'image', // ou 'video'
|
|
370
|
+
headerLink: 'https://example.com/image1.jpg',
|
|
371
|
+
bodyText: 'Oferta especial!', // Máximo 160 caracteres
|
|
372
|
+
buttonText: 'Comprar agora', // Máximo 20 caracteres
|
|
373
|
+
url: 'https://example.com/product1'
|
|
297
374
|
},
|
|
298
375
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
376
|
+
cardIndex: 1,
|
|
377
|
+
headerType: 'image',
|
|
378
|
+
headerLink: 'https://example.com/image2.jpg',
|
|
379
|
+
bodyText: 'Novo lançamento!',
|
|
380
|
+
buttonText: 'Ver detalhes',
|
|
381
|
+
url: 'https://example.com/product2'
|
|
304
382
|
}
|
|
305
383
|
]
|
|
306
384
|
}, accessToken);
|
|
@@ -326,8 +404,10 @@ console.log(media.data.size); // Tamanho em bytes
|
|
|
326
404
|
```typescript
|
|
327
405
|
await sdk.whatsapp.replyMessage({
|
|
328
406
|
token: 'sk_live_...',
|
|
329
|
-
|
|
330
|
-
messageText: 'Esta é uma resposta!'
|
|
407
|
+
sender: '5511999999999', // Obrigatório
|
|
408
|
+
messageText: 'Esta é uma resposta!',
|
|
409
|
+
replyMessageId: 'wamid.xxx', // Opcional: ID da mensagem a responder
|
|
410
|
+
preview_url: false // Opcional: se true, mostra preview de URLs no texto
|
|
331
411
|
}, accessToken);
|
|
332
412
|
```
|
|
333
413
|
|
|
@@ -336,8 +416,9 @@ await sdk.whatsapp.replyMessage({
|
|
|
336
416
|
```typescript
|
|
337
417
|
await sdk.whatsapp.reactMessage({
|
|
338
418
|
token: 'sk_live_...',
|
|
339
|
-
|
|
340
|
-
emoji: '👍'
|
|
419
|
+
sender: '5511999999999', // Obrigatório
|
|
420
|
+
emoji: '👍', // Emoji da reação
|
|
421
|
+
message_id: 'wamid.xxx' // Opcional: ID da mensagem específica a reagir
|
|
341
422
|
}, accessToken);
|
|
342
423
|
```
|
|
343
424
|
|
|
@@ -364,13 +445,16 @@ await sdk.whatsapp.createTemplate({
|
|
|
364
445
|
]
|
|
365
446
|
}, accessToken);
|
|
366
447
|
|
|
367
|
-
// Upload de mídia para template
|
|
448
|
+
// Upload de mídia para template ou uso em mensagens
|
|
368
449
|
const file = new File(['...'], 'image.jpg', { type: 'image/jpeg' });
|
|
369
|
-
await sdk.whatsapp.uploadMedia({
|
|
450
|
+
const uploadResult = await sdk.whatsapp.uploadMedia({
|
|
370
451
|
token: 'sk_live_...',
|
|
371
452
|
file: file,
|
|
372
453
|
filename: 'image.jpg'
|
|
373
454
|
}, accessToken);
|
|
455
|
+
|
|
456
|
+
// Use o mediaId retornado em sendAudio, sendVideo, sendDocument ou sendSticker
|
|
457
|
+
const mediaId = uploadResult.data.handle; // Formato: "4::aW1hZ2UtMTIzNDU2Nzg5MGCE..."
|
|
374
458
|
```
|
|
375
459
|
|
|
376
460
|
### Telegram
|
package/dist/index.d.mts
CHANGED
|
@@ -87,19 +87,22 @@ interface SendWhatsAppTemplateParams {
|
|
|
87
87
|
interface SendWhatsAppButtonsParams {
|
|
88
88
|
token: string;
|
|
89
89
|
sender: string;
|
|
90
|
-
|
|
90
|
+
text: string;
|
|
91
91
|
buttons: Array<{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
id: string;
|
|
95
|
-
title: string;
|
|
96
|
-
};
|
|
92
|
+
id: string;
|
|
93
|
+
title: string;
|
|
97
94
|
}>;
|
|
95
|
+
media?: {
|
|
96
|
+
type: string;
|
|
97
|
+
url: string;
|
|
98
|
+
};
|
|
98
99
|
}
|
|
99
100
|
interface SendWhatsAppListParams {
|
|
100
101
|
token: string;
|
|
101
102
|
sender: string;
|
|
102
|
-
|
|
103
|
+
headerText: string;
|
|
104
|
+
bodyText: string;
|
|
105
|
+
footerText?: string;
|
|
103
106
|
buttonText: string;
|
|
104
107
|
sections: Array<{
|
|
105
108
|
title: string;
|
|
@@ -112,13 +115,16 @@ interface SendWhatsAppListParams {
|
|
|
112
115
|
}
|
|
113
116
|
interface ReplyWhatsAppParams {
|
|
114
117
|
token: string;
|
|
115
|
-
|
|
118
|
+
sender: string;
|
|
116
119
|
messageText: string;
|
|
120
|
+
replyMessageId?: string;
|
|
121
|
+
preview_url?: boolean;
|
|
117
122
|
}
|
|
118
123
|
interface ReactWhatsAppParams {
|
|
119
124
|
token: string;
|
|
120
|
-
|
|
125
|
+
sender: string;
|
|
121
126
|
emoji: string;
|
|
127
|
+
message_id?: string;
|
|
122
128
|
}
|
|
123
129
|
interface CreateTemplateParams {
|
|
124
130
|
token: string;
|
|
@@ -149,47 +155,113 @@ interface UploadMediaParams {
|
|
|
149
155
|
interface SendOrderDetailsParams {
|
|
150
156
|
token: string;
|
|
151
157
|
sender: string;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
price: number;
|
|
158
|
-
}>;
|
|
159
|
-
orderTotal: number;
|
|
158
|
+
headerText?: string;
|
|
159
|
+
bodyText: string;
|
|
160
|
+
footerText?: string;
|
|
161
|
+
reference_id: string;
|
|
162
|
+
type: 'digital-goods' | 'physical-goods';
|
|
160
163
|
currency: string;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
total_amount: {
|
|
165
|
+
value: number;
|
|
166
|
+
offset: number;
|
|
167
|
+
description?: string;
|
|
168
|
+
};
|
|
169
|
+
order: {
|
|
170
|
+
status: 'pending' | 'processing' | 'partially-shipped' | 'shipped' | 'completed' | 'canceled';
|
|
171
|
+
catalog_id?: string;
|
|
172
|
+
items: Array<{
|
|
173
|
+
retailer_id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
amount: {
|
|
176
|
+
value: number;
|
|
177
|
+
offset: number;
|
|
178
|
+
description?: string;
|
|
179
|
+
};
|
|
180
|
+
quantity: number;
|
|
181
|
+
sale_amount?: {
|
|
182
|
+
value: number;
|
|
183
|
+
offset: number;
|
|
184
|
+
description?: string;
|
|
185
|
+
};
|
|
186
|
+
}>;
|
|
187
|
+
subtotal: {
|
|
188
|
+
value: number;
|
|
189
|
+
offset: number;
|
|
190
|
+
description?: string;
|
|
191
|
+
};
|
|
192
|
+
tax: {
|
|
193
|
+
value: number;
|
|
194
|
+
offset: number;
|
|
195
|
+
description?: string;
|
|
196
|
+
};
|
|
197
|
+
shipping?: {
|
|
198
|
+
value: number;
|
|
199
|
+
offset: number;
|
|
200
|
+
description?: string;
|
|
201
|
+
};
|
|
202
|
+
discount?: {
|
|
203
|
+
value: number;
|
|
204
|
+
offset: number;
|
|
205
|
+
description?: string;
|
|
206
|
+
discount_program_name?: string;
|
|
207
|
+
};
|
|
208
|
+
expiration?: {
|
|
209
|
+
timestamp: string;
|
|
210
|
+
description: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
payment_settings?: Array<{
|
|
214
|
+
type: 'pix_dynamic_code' | 'payment_link' | 'boleto' | 'offsite_card_pay';
|
|
215
|
+
pix_dynamic_code?: {
|
|
216
|
+
code: string;
|
|
217
|
+
merchant_name: string;
|
|
218
|
+
key: string;
|
|
219
|
+
key_type: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'EVP';
|
|
220
|
+
};
|
|
221
|
+
payment_link?: {
|
|
222
|
+
uri: string;
|
|
223
|
+
};
|
|
224
|
+
boleto?: {
|
|
225
|
+
digitable_line: string;
|
|
226
|
+
};
|
|
227
|
+
offsite_card_pay?: {
|
|
228
|
+
last_four_digits: string;
|
|
229
|
+
credential_id: string;
|
|
230
|
+
};
|
|
164
231
|
}>;
|
|
165
232
|
}
|
|
166
233
|
interface SendOrderStatusParams {
|
|
167
234
|
token: string;
|
|
168
235
|
sender: string;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
236
|
+
bodyText: string;
|
|
237
|
+
footerText?: string;
|
|
238
|
+
reference_id: string;
|
|
239
|
+
order_status: 'pending' | 'processing' | 'partially-shipped' | 'shipped' | 'completed' | 'canceled';
|
|
240
|
+
status_description?: string;
|
|
241
|
+
payment_status?: 'pending' | 'captured' | 'failed';
|
|
242
|
+
payment_timestamp?: number;
|
|
172
243
|
}
|
|
173
244
|
interface SendWhatsAppAudioParams {
|
|
174
245
|
token: string;
|
|
175
246
|
sender: string;
|
|
176
|
-
|
|
247
|
+
mediaId: string;
|
|
248
|
+
voice?: boolean;
|
|
177
249
|
}
|
|
178
250
|
interface SendWhatsAppStickerParams {
|
|
179
251
|
token: string;
|
|
180
252
|
sender: string;
|
|
181
|
-
|
|
253
|
+
mediaId: string;
|
|
182
254
|
}
|
|
183
255
|
interface SendWhatsAppVideoParams {
|
|
184
256
|
token: string;
|
|
185
257
|
sender: string;
|
|
186
|
-
|
|
258
|
+
mediaId: string;
|
|
187
259
|
caption?: string;
|
|
188
260
|
}
|
|
189
261
|
interface SendWhatsAppDocumentParams {
|
|
190
262
|
token: string;
|
|
191
263
|
sender: string;
|
|
192
|
-
|
|
264
|
+
mediaId: string;
|
|
193
265
|
filename?: string;
|
|
194
266
|
caption?: string;
|
|
195
267
|
}
|
|
@@ -246,30 +318,34 @@ interface SendWhatsAppLocationParams {
|
|
|
246
318
|
interface SendWhatsAppLocationRequestParams {
|
|
247
319
|
token: string;
|
|
248
320
|
sender: string;
|
|
249
|
-
|
|
321
|
+
bodyText: string;
|
|
322
|
+
headerText?: string;
|
|
323
|
+
footerText?: string;
|
|
250
324
|
}
|
|
251
325
|
interface SendWhatsAppCtaUrlParams {
|
|
252
326
|
token: string;
|
|
253
327
|
sender: string;
|
|
254
|
-
|
|
328
|
+
bodyText: string;
|
|
255
329
|
buttonText: string;
|
|
256
330
|
url: string;
|
|
331
|
+
header?: {
|
|
332
|
+
type: 'text' | 'image' | 'video' | 'document';
|
|
333
|
+
text?: string;
|
|
334
|
+
link?: string;
|
|
335
|
+
};
|
|
336
|
+
footerText?: string;
|
|
257
337
|
}
|
|
258
338
|
interface SendWhatsAppMediaCarouselParams {
|
|
259
339
|
token: string;
|
|
260
340
|
sender: string;
|
|
341
|
+
bodyText: string;
|
|
261
342
|
cards: Array<{
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
description: string;
|
|
269
|
-
actions: Array<{
|
|
270
|
-
type: 'link';
|
|
271
|
-
value: string;
|
|
272
|
-
}>;
|
|
343
|
+
cardIndex: number;
|
|
344
|
+
headerType: 'image' | 'video';
|
|
345
|
+
headerLink: string;
|
|
346
|
+
bodyText: string;
|
|
347
|
+
buttonText: string;
|
|
348
|
+
url: string;
|
|
273
349
|
}>;
|
|
274
350
|
}
|
|
275
351
|
interface DownloadWhatsAppMediaParams {
|