API - SISTEMA | BAILEYS | OFIC...
Botão Copiar / Colar
1min
PHP
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendCopyPaste',
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_copy",
19 "params": "{\\"display_text\\":\\"Copiar Código PIX CNPJ para Pagamento\\",\\"id\\":\\"6deb1c2f-7863-45eb-8b11-17a8f8131288\\",\\"copy_code\\":\\"13959856000130\\",\\"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 Sep 2024
Did this page help you?