API Enviar Imagem por URL
🧩 Envia uma imagem a partir de uma URL.
API: Básica
Verifique aqui os Pré-Requisitos para utilizar APIs
Endpoint
https://{BACKEND_URL}/api/messages/sendURLImage
Método
POST
Autenticação
Bearer {seutokenaqui}
Payload
{
"number": "",
"body": "https://s3.typebot.io/public/workspaces/clozv34id002ljx0fpagmqor4/typebots/clozv9d7f0004l50go6cgxv4u/blocks/undv5w2a81os520srvrb4tp5?v=1701958989883",
"mimeType": "image/jpeg",
"caption": "teste de caption"
}
➡️ “number”: telefone do destinatário no formato ddi ddd numero (somente números). ➡️ “body”: URL do arquivo. ➡️ “mimeType”: image/jpeg ➡️ “caption”: legenda. API Utilize o código em requisições HTTPS com ferramentas como cURL ou bibliotecas de integração.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendURLImage',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"number": "",
"body": "https://s3.typebot.io/public/workspaces/clozv34id002ljx0fpagmqor4/typebots/clozv9d7f0004l50go6cgxv4u/blocks/undv5w2a81os520srvrb4tp5?v=1701958989883",
"mimeType": "image/jpeg",
"caption": "teste de caption"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer {seutokenaqui}' //Token cadastrado na conexão
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;