API - SISTEMA | BAILEYS | OFIC...
Botão URL
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendURLBTN',
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 "customData": {
17 "body": "Aqui vem o Body",
18 "name": "cta_url",
19 "params": "{\\"display_text\\":\\"Ir para Site2\\",\\"id\\":\\"aaaaaa-7863-45eb-8b11-17a8f8132388\\",\\"url\\":\\"https://www.google.com.br\\",\\"disabled\\":false}"
20 }
21 }',
22 CURLOPT_HTTPHEADER => array(
23 'Content-Type: application/json',
24 'Authorization: Bearer seutokenaqui' //Token cadastrado na conexão
25 ),
26));
27
28$response = curl_exec($curl);
29
30curl_close($curl);
31echo $response;
32
Updated 07 Jan 2025

Did this page help you?