> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/expert-center/pt-br/faq-and-troubleshooting/iot-logic/how-to-connect-telegram-with-navixy-iot-logic..md).

# Como conectar o Telegram ao Navixy-IoT Logic.

Este é um guia rápido dos passos que podem ser seguidos para criar a conexão entre a lógica IoT e o Telegram.

1\) Crie um bot e obtenha seu token

* No Telegram, abra o chat com @BotFather.
* Execute o comando /newbot.
* Siga as instruções e copie o token do bot fornecido (ele se parece com: 123456:ABC-...).

2\) Obtenha o chat\_id para o qual deseja enviar mensagens

Formas comuns de fazer isso:

* Envie uma mensagem para o seu bot (ou adicione-o a um grupo e envie uma mensagem lá).
* Em seguida, chame o método getUpdates da API do Telegram.
* Se for um grupo, o chat\_id geralmente é um número negativo.
* Certifique-se de que o bot tenha recebido pelo menos uma mensagem para que ele apareça em getUpdates.

<figure><img src="/files/759eaa0328b63ef7671b2ebcb944f9ca1b748007" alt=""><figcaption></figcaption></figure>

3\) Envie a mensagem (chamada REST)

* Use o método sendMessage da API do Telegram.
* No corpo da solicitação, inclua o chat\_id e o texto da mensagem.
* A solicitação deve ser enviada em formato JSON com o cabeçalho Content-Type: application/json.

<figure><img src="/files/988eae0089d02d4c29beb0a9c99c0fe5d4c7c85b" alt=""><figcaption></figcaption></figure>

4\) Crie o IoT Flow na Navixy

* Depois que o fluxo tiver sido criado, conecte o nó Webhook na seção em que deseja enviar os dados.
* Siga a mesma estrutura da chamada da API. No campo URL, insira o endpoint da solicitação:

<https://api.telegram.org/bot\\>\<BOT\_TOKEN>/sendMessage

* Na seção Headers:
* Chave: Content-Type
* Valor: application/json
* Por fim, no corpo da solicitação, inclua os parâmetros de telemetria que deseja enviar, certificando-se de incluir novamente o chat\_id, por exemplo:

{

"chat\_id": X,

"text": "Device 12563254, latitude: {{latitude}}, longitude: {{longitude}}, satellites: {{satellites}}, speed: {{speed}}"

}

![](/files/09c213d1586bd870432f80dd77de0380005424de) ![](/files/929330dd573296b8e899086f94b4ad7f96f316c9)

Com esses passos, seu bot poderá receber mensagens com sucesso, incluindo dados de telemetria automatizados da Navixy.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://navixy.com/docs/expert-center/pt-br/faq-and-troubleshooting/iot-logic/how-to-connect-telegram-with-navixy-iot-logic..md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
