<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendOfficialData',
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": "554799444499",
"text": "Mensagem Desejada"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer tokenmeu'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"response": {
"from": "9aa5ed74-6d9c-4292-b44e-7f8ee2bfa022",
"to": "554799444499",
"contents": "{\"type\":\"text\",\"text\":\"Teste\"}",
"id": "ab019db2-4172-4eea-910c-d88fdd64f386",
"direction": "OUT"
}
}