API - SISTEMA | BAILEYS | OFIC...
Enviar Áudio por URL
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendURLAudio',
7 CURLOPT_RETURNTRANSFER => true,
8 CURLOPT_ENCODING => '',
9 CURLOPT_MAXREDIRS => 10,
10 CURLOPT_TIMEOUT => 0,
11 CURLOPT_FOLLOWLOCATION => true,
12 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 CURLOPT_CUSTOMREQUEST => 'POST',
14 CURLOPT_POSTFIELDS =>'{
15 "number": "5511989091838",
16 "body": "https://s3.typebot.io/public/workspaces/clozv34id002ljx0fpagmqor4/typebots/clozv9d7f0004l50go6cgxv4u/blocks/raycbyurlc6xybynm84b41mw?v=1701959327584",
17 "mimeType": "audio/mpeg",
18 "ptt": true
19 }',
20 CURLOPT_HTTPHEADER => array(
21 'Content-Type: application/json',
22 'Authorization: Bearer seu token aqui'
23 ),
24));
25
26$response = curl_exec($curl);
27
28curl_close($curl);
29echo $response;
30
31
Updated 19 May 2024

Did this page help you?