---
title: Mensagem HUB (Texto)
slug: mensagem-hub-texto
docTags: 
createdAt: 2024-12-25T18:44:52.059Z
---

```php
<?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": "5511989091838",
"text": "Mensagem Desejada"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer tokenmeu'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

```json
{
    "response": {
        "from": "9aa5ed74-6d9c-4292-b44e-7f8ee2bfa022",
        "to": "5511989091838",
        "contents": "{\"type\":\"text\",\"text\":\"Teste\"}",
        "id": "ab019db2-4172-4eea-910c-d88fdd64f386",
        "direction": "OUT"
    }
}
```

