> 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 com Navixy IoT Logic

Integre um bot do Telegram ao IoT Logic da Navixy para enviar notificações automatizadas. Configure o bot, defina o ID do chat e conecte o webhook.

Este é um guia rápido dos passos que podem ser seguidos para criar a conexão entre IoT Logic e 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 você quer enviar a mensagem

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="https://1173629567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIgDb43gtyXcm1Av4h1np%2Fuploads%2Fgit-blob-f7f6fcc34d0900aa010886b55597bc81e71d8210%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Enviar 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="https://1173629567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIgDb43gtyXcm1Av4h1np%2Fuploads%2Fgit-blob-a9dcc4cc6160133e664cb4b261ded66af5317460%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Crie o fluxo de IoT em Navixy

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

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

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

{

"chat\_id": X,

"text": "Dispositivo 12563254, latitude: {{latitude}}, longitude: {{longitude}}, satélites: {{satellites}}, velocidade: {{speed}}"

}

![](https://1173629567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIgDb43gtyXcm1Av4h1np%2Fuploads%2Fgit-blob-3ffecccdbc856d2256330f9ead8b2c6556fea221%2Funknown.png?alt=media) ![](https://1173629567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIgDb43gtyXcm1Av4h1np%2Fuploads%2Fgit-blob-f5de8300a0b21fe30afa42ef8ebf93a335d88ead%2Funknown.png?alt=media)

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


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
