> For the complete documentation index, see [llms.txt](https://sejasuri.gitbook.io/manual-de-integracao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sejasuri.gitbook.io/manual-de-integracao/api.md).

# API

Através de nossa API, é possível solicitar dados e realizar ações importantes na Suri.

### URL da API

A URL base de acesso à API é o e*ndpoint* do chatbot, que pode ser encontrado na página de Configurações do [Portal](https://portal.chatbotmaker.io/), seguido de `/api`.

{% hint style="success" %}
Exemplo de URL base de chamada da API:

`https://xxx.azurewebsites.net/api`
{% endhint %}

<figure><img src="/files/QlxOb0rUShymJY5YTfng" alt=""><figcaption></figcaption></figure>

### Autenticacão

**A autenticação da API se dá através de&#x20;*****Bearer token***, cujo token também pode ser encontrado na tela de Configurações, logo acima do campo e*ndpoint*.

{% hint style="success" %}
Adicione o seguinte item ao *header* de sua requisicão, substituindo XXX pelo seu token:

`Authorization: Bearer XXXX`

Cada *endpoint* é único por chatbot, portanto, é um ambiente seguro e que deve apresentar baixa latência. É importante certificar-se de armazenar token de acesso e *endpoint* de forma segura em sua aplicação.
{% endhint %}

### Utilizacão

Como toda API, é a forma ativa de realizar ações na Suri, diferente dos *webhooks*, que representam uma forma passiva (onde seu serviço recebe eventos). Acessando nossa [documentação](https://documenter.getpostman.com/view/17684221/UUxz9mt5#b620644f-3971-4e54-97f3-5f581b67df79) é possível encontrar todas as possibilidades, mas podemos citar algumas das mais utilizadas:

* [Importar contato](https://documenter.getpostman.com/view/17684221/UUxz9mt5#e5e66ac6-d9bd-4138-8fd3-02d057c4d65d): importa novo contato do canal WhatsApp para o chatbot e Portal de atendimento, podendo preencher e-mail, observações, documento de identificação, etc.
* [Listar contatos](https://documenter.getpostman.com/view/17684221/UUxz9mt5#e5e66ac6-d9bd-4138-8fd3-02d057c4d65d): lista todos os contatos do chatbot em questão, trazendo todos os dados.
* [Enviar mensagem](https://documenter.getpostman.com/view/17684221/UUxz9mt5#31654c0c-ccd2-4252-871d-ef2180ab6ed7): envia nova mensagem para o contato identificado pelo ID informado. Podendo ser mensagem de texto, mídia ou template de WhatsApp.
* [Listar mensagens de contato](https://documenter.getpostman.com/view/17684221/UUxz9mt5#31654c0c-ccd2-4252-871d-ef2180ab6ed7): lista mensagens trocadas com contato, contendo mensagens de chatbot e agente humano.


---

# 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:

```
GET https://sejasuri.gitbook.io/manual-de-integracao/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
